       (resources "/react" {:root "react"})
       (route/not-found "Page not found"))
 
-    (let [event-handler-fut (start-event-handler sente peer-config)
+    (let [deployments (atom {})
+          tracking (atom {})
+          event-handler-fut (start-event-handler sente peer-config deployments tracking)
           ; TODO: no way to currently stop this watch
           _ (refresh-deployments-watch (partial send-mult-fn 
                                                 (:chsk-send! sente) 
                                                 (:connected-uids sente)) 
-                                       (zk/connect (:zookeeper/address peer-config)))
-          my-ring-handler (ring.middleware.defaults/wrap-defaults my-routes ring-defaults-config)
-          server (http-kit-server/run-server my-ring-handler {:port 3000})
+                                       (zk/connect (:zookeeper/address peer-config))
+                                       deployments)
+          handler (ring.middleware.defaults/wrap-defaults routes ring-defaults-config)
+          server (http-kit-server/run-server handler {:port 3000})
           uri (format "http://localhost:%s/" (:local-port (meta server)))]
       (println "Http-kit server is running at" uri)
-      (assoc component :server server :event-handler-fut event-handler-fut)))
-  (stop [{:keys [server] :as component}]
+      (assoc component 
+             :server server 
+             :event-handler-fut event-handler-fut 
+             :deployments deployments 
+             :tracking tracking)))
+  (stop [{:keys [server tracking deployments] :as component}]
     (println "Stopping HTTP Server")
-    (stop-all-tracking!)
+    (stop-all-tracking! tracking)
     (future-cancel (:event-handler-fut component))
     (server :timeout 100)
-    (assoc component :server nil :event-handler-fut nil)))
+    (assoc component :server nil :event-handler-fut nil :deployments nil :tracking nil)))
 
 (defn new-http-server [peer-config]
   (map->HttpServer {:peer-config peer-config}))
-

(defrecord HttpServer [peer-config]
  component/Lifecycle
  (start [{:keys [sente] :as component}]

    ; Just reset atoms for now. Atoms should be created and reset in here
    (reset! tracking {})
    (reset! deployments {})

    (println "Starting HTTP Server")

    (defroutes my-routes
      (GET  "/" [] (page))
      (GET  "/chsk" req ((:ring-ajax-get-or-ws-handshake sente) req))
      (POST "/chsk" req ((:ring-ajax-post sente) req))

                         :modified-at (java.util.Date. (:mtime stat))})))
         (into {})
         (reset! deployments)
         (distribute-deployment-listing send-all-fn!))
    (do
      (println (format "Could not find deployments at %s. Retrying in 1s." zk-onyx/root-path))
      (Thread/sleep 1000)
      (recur send-all-fn! zk-client deployments))))

(defn event->uid [event]
  (get-in event [:ring-req :cookies "ring-session" :value]))

(defn start-event-handler [sente peer-config deployments tracking]
  (future
    (loop []
      (when-let [event (<!! (:ch-chsk sente))]
