I'd rather fix it in the following way:

    if (this.apiKey) {
      opt_params = opt_params || {};
      opt_params.key = this.apiKey;
    }
    if (opt_params) {
      url += '?' + querystring.stringify(opt_params);
    }