docs: function responseHandler(err, res) {
              //console.log('resp', err, res.status);
              // Handle connection HTTPS errors.
              if (err){
                  d.reject(err);
              }else {
                  var answer = {
                      code: res.status,
                      headers: res.headers,
                      data: res.body
                  };
  
                  // Check if response is IDOL API error or not
                  if (res.status < 200 || res.status >= 300) {
                      // YES it is error.
                      // Resolve the promise with the error.
                      d.reject(answer);
                  } else {
                      // NO it is not error.
                      // Queue the job for polling if it is async job.
                      if (options.type == 'async' && Boolean(self.options.autoResult)) {
                          self
                              .jobResult(res.body.jobID)
                              .done(
                                  _.partial(self.emit, 'job result'),
                                  _.partial(self.emit, 'job result error')
                          );
                      }
                      // Resolve the promise with the result.
                      d.resolve(answer);
                  }
              }
          }