       requestConfig = _.extend({url}, opts, options)
       return if AppStore.isPending(requestConfig)
 
-      resolved = ({headers, data}) ->
-        setNow(headers)
-        successAction(data, args...) # Include listenAction for faking
+      resolved = ({data}) ->
+        successAction(data, args...)
 
       rejected = (response) ->
-        # jqXhr, statusMessage, err
-        statusCode = response.status
-        statusMessage = response.statusText
+        {status, statusText, statusMessage, handled} = response
 
-        if response.headers
-          setNow(response.headers)
-        else
-          AppActions.setServerError(statusCode, statusMessage, _.extend({url}, opts))
+        AppActions.setServerError(status, statusText, requestConfig)
+        return if handled
 
-        if statusCode is 400
-          CurrentUserActions.logout()
-        # TODO eventually pull this out to the interceptors as well or remove if no longer needed
-        else if statusMessage is 'parsererror' and statusCode is 200 and IS_LOCAL
-          if httpMethod is 'PUT' or httpMethod is 'PATCH'
-            # HACK for PUT
-            successAction(null, args...)
-          else
-            # Hack for local testing. Webserver returns 200 + HTML for 404's
-            Actions.FAILED(404, 'Error Parsing the JSON or a 404', args...)
-        else if statusCode is 404
-          Actions.FAILED(statusCode, 'ERROR_NOTFOUND', args...)
-        else
-          # Parse the error message and fail
-          try
-            msg = JSON.parse(statusMessage)
-          catch e
-            msg = statusMessage
-
-          Actions.FAILED(statusCode, msg, args...)
+        Actions.FAILED(status, statusMessage, args...)
 
       axios(requestConfig)
         .then(resolved, rejected)

  payload = if response.config.data then JSON.parse(response.config.data) else {}
  response.data = _.extend({}, response.data, payload)

setUpXHRInterceptors = ->
  axios.interceptors.request.use (requestConfig) ->
    AppActions.queRequest(requestConfig)

    makeLocalRequest(requestConfig) if IS_LOCAL

    requestConfig

  axios.interceptors.response.use (response) ->
    {status, statusText, config} = response
    AppActions.setServerSuccess(status, statusText, config)

    makeLocalResponse(response) if IS_LOCAL

    response

  , (errorResponse) ->

    if _.isError(errorResponse)
      errorResponse =
        status: 1
        statusText: "#{errorResponse.name}: #{errorResponse.message}"
    else
      {status, statusText, config} = errorResponse
      AppActions.setServerError(status, statusText, config)

    Promise.reject(errorResponse)

apiHelper = (Actions, listenAction, successAction, httpMethod, pathMaker, options) ->
  listenAction.addListener 'trigger', (args...) ->

    url_parts = ["#{uri}.json", params]
  else
    url_parts = ["#{uri}/#{requestConfig.method}.json", params]
    requestConfig.mockMethod = requestConfig.method
    requestConfig.method = 'GET'


  requestConfig.url = _.compact(url_parts).join('?')

