Do not pass a "api_key" parameter if it's not defined.

Note that if "api_key" is explicitely set to an empty string it will be
passed to the API probably triggering an exception.