     (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]

(defn ^:export tag-show []
  (let [$tag-box ($ :#tag_box)
        tag (util/match-from-current-uri #"[^\/]+$")]
    (backend-request (path-to "/tag?tag=" tag)
      (fn [data]
        (if (string? data)
          (alert data)

    (-> (jq/find search-box :h2)
      (inner (str "Search results for '" query "'"))) 
    (.blur text-field)
    (backend-request (path-to "/mls") (partial create-search-table search-box) :data {:query query})
    (when callback (callback query))))

(defn create-url [$text $button]
  (backend-request (path-to "/add")
    (fn [data]
      (alert (format "Added '%s'" (jq/val $text)) :info)
      (jq/text $button "Add Url")
      (jq/val $text "")
      (jq/hide $text))
    :type "POST"
    :data {:input (jq/val $text)}))

(defn add-url [$text $button event]
  (if (jq/is $text ":visible")
