 
     return deferred
 
-
 module.exports = Api

  # Construct a new API binding
  #
  #  authToken: The authentication token with which we can access the DNAnexus API.
  # options:
  #   apiServer: Override the API server information. Default: "api.dnanexus.com"
  #   maxAJAXTrials: The number of times to retry an AJAX request. Default: 5

    input =
      headers: headers
      data: input
      maxRetries: @maxAJAXTrials

    if options.withCredentials == true
      input.withCredentials = true

    ajaxRequest = Api._ajaxRequest(url, input)

    # Decorate the deferred object with an abort method which cancels the ajax request and sets the internal
    # state of the deferred object to aborted, which prevents the deferred object from being resolved
