         device-identifier (:client (:metadata form-data))]
     (formmodel/add-form-data form-data form-id device-identifier)))
 
-(defn- routes []
+(defn- routes [mqtt]
   #{["/api/forms"                :get    (conj common-interceptors `http-get-all-forms)]
-    ["/api/forms"                :post   (conj common-interceptors check-auth `http-create-form)]
-    ["/api/forms/:form-key"      :delete (conj common-interceptors check-auth `http-delete-form-by-key)]
+    ["/api/forms"                :post   (conj common-interceptors check-auth (partial http-create-form mqtt)) :route-name :create-form]
+    ["/api/forms/:form-key"      :delete (conj common-interceptors check-auth (partial http-delete-form-by-key mqtt)) :route-name :delete-form]
     ["/api/forms/:form-key"      :get    (conj common-interceptors check-auth `http-get-form-by-form-key)]
     ;; todo: need to figure out why forms causes a route conflict
     ["/api/form/:form-id/submit"   :post   (conj common-interceptors check-auth `http-submit-form-data) :constraints {:form-id #"[0-9]+"}]

            [spacon.models.form :as formmodel]
            [spacon.components.mqtt :as mqttapi]
            [clojure.spec :as s]
            [clojure.data.json :as json])
  (:import java.net.URLDecoder))

(defn http-get-all-forms
  ;; todo: get all the forms for all the teams that the calling user belongs to

  component/Lifecycle
  (start [this]
    (mqttapi/subscribe mqtt "/store/form" mqtt->form-submit)
    (assoc this :routes (routes mqtt)))
  (stop [this]
    this))

