           item)))
     steps))
 
-(defn- state
+(defn- create-service-handler
   []
-  (-> @settings/state
-      (assoc :ports @ports/state)
-      (assoc :variables @variables/state)))
+  (POST "/services"
+        {:format  :json
+         :params  (-> @settings/state
+                      (assoc :ports @ports/state)
+                      (assoc :variables @variables/state))
+         :finally (progress/mount!)
+         :handler
+                  (fn [response]
+                    (let [id (get response "ID")]
+                      (progress/unmount!)
+                      (router/dispatch! (str "/#/services/" id))
+                      (message/mount!
+                        (str "Service " id " has been created."))))
+         :error-handler
+                  (fn [{:keys [status status-text]}]
+                    (progress/unmount!)
+                    (message/mount!
+                      (str "Service creation failed. Status: " status " Reason: " status-text)))}))
 
 (rum/defc form < rum/reactive []
   (let [index (rum/react step-index)]

            [swarmpit.component.service.form-ports :as ports]
            [swarmpit.component.service.form-variables :as variables]
            [swarmpit.component.message :as message]
            [rum.core :as rum]
            [ajax.core :refer [POST]]))


         (material/raised-button
           #js {:label      "Create"
                :primary    true
                :onTouchTap (create-service-handler)}))]]]))

(defn- init-settings-state
  []
