 
 (defn subdb-upload [hash stream]
   (go-catch
-    (let [uri (str *subdb-endpoint* "?action=upload")
-          params {:uri     uri
-                  :headers {"User-Agent" subdb-ua}}
+    (let [params (subdb-query "upload")
           build-form (fn [f]
                        (.append f "hash" hash)
                        (.append f "file" stream #js {:contentType "application/octet-stream"}))


      (node/md5-hex buffer))))

(defn subdb-search-languages [hash]
  (go-catch
    (let [uri (str *subdb-endpoint* "?action=search&hash=" hash "&versions")
          params {:uri     uri
                  :headers {"User-Agent" subdb-ua}}
          response (<? (http params))
          status (.-statusCode response)
          parse-language (fn [l] (let [[lang count] (.split l ":")]

  ([hash language] (subdb-download hash language 0))
  ([hash language version]
   (go-catch
     (let [params (subdb-query "download" {:hash hash :version version :language language})
           response (<? (http params))
           status (.-statusCode response)]
       (if (= 200 status)
