Shared API execution logic to avoid code duplication between ApiWorker and LinkRunner
Execute an API call based on the method and parameters