if (is_null($method)) {
            throw new InvalidArgumentException("No API method specified");
        }