    :content-type "application/xml"
    :write identity})
 
-(defn normalize-error-response [default-response url]
+(defn normalize-error-response [default-response props]
   (-> default-response
+      (merge props)
       (assoc :status-code (:status default-response))
       (assoc :resp (get-in default-response [:response :resp]))
-      (assoc :status :failed)
-      (assoc :url url)))
+      (assoc :status :failed)))
 
 ;; TODO only implementing JSON format and not implementing prefixes for now since we don't use either
 (defn ajax [method url message channel & {:keys [params keywords? context headers]

                             :handler #(binding [frontend.async/*uuid* uuid]
                                         (put! channel [message :success (assoc % :context context)]))
                             :error-handler #(binding [frontend.async/*uuid* uuid]
                                               (put! channel [message :failed (normalize-error-response % url)]))
                             :finally #(binding [frontend.async/*uuid* uuid]
                                         (put! channel [message :finished context]))}))))


                                             headers)
                             :handler #(put! channel (assoc % :status :success))
                             ;; TODO: clean this up
                             :error-handler #(put! channel (normalize-error-response % {:url url}))
                             :finally #(close! channel)}))
    channel))

