             # TODO: Notify the client that the API server is down temporarily
 
           else if textStatus == "error" && jqXHR.status == 0
-            if trial > @maxAJAXTrials
+            if trial > maxRetries
               rejectStatus({ type: "AjaxError", details: {jqXHR: jqXHR}})
             else
               # Backoff/Retry


    return deferred


module.exports = Api

  #   dataType: Passed straight through to jquery ajax if using jquery, else ignored
  #   skipConversion: If true, object data will not be converted to JSON
  #   withCredentials: A boolean indicating whether or not the with credentials xhrFlag should be set. Default is false
  #   maxRetries: The maximum number of times to retry the request if it fails due to a network error. Default is 5.
  #
  # Returns a deferred object with has an abort method added
  #
  @_ajaxRequest: (url, options = {}, trial = 0) ->
    status = $.Deferred()
    headers = options.headers ? {}
    data = options.data
    method = options.method ? "POST"
    maxRetries = options.maxRetries ? 5

    request = null

