     (alert (error-msg path msg))))
 
 (defn backend-request
-  ([path f] (backend-request path f alert-error))
-  ([path f alert-fn]
+  "Given a path and success fn makes a request using $.ajax. Additional arguments are
+  interpreted as options to $.ajax. Also accepts a :alert-fn option to create a
+  specialized error fn."
+  [path f & {:keys [type alert-fn] :or {type "GET" alert-fn alert-error} :as options}]
   (jq/ajax
     (str "http://localhost:3000/api" path)
-    {:dataType "edn"
-     :error #(apply alert-fn path %&)
-     :success f
-     })))
+    (merge
+      {:dataType "edn"
+       :error #(apply alert-fn path %&)
+       :type type
+       :success f
+       } options)))
 
 ;;; js update fns
 (defn- add-sort-to [parent-div]


    (backend-request (path-to "/tags")
      #(jq/after $text-field (view/generate-datalist %))
      console-error)

    (when-let [query (when (seq query-param) (second query-param))]
      (jq/val $text-field query)

        value (jq/text $elem)]
    (.blur $elem)
    (backend-request
      (path-to "/edit")
      (fn [data]
        (log "Received from server:")
        (log-clj data)
        (set-edit-state "edit-completed" event))
      :type "POST"
      :data {:id id field value}
      :alert-fn (fn [& args]
        (set-edit-state "edit-failed" event)
        (apply alert-error args)
        ))))
