                           (swap! server-state update-in [:out-chans] (fn [old new] (vec (remove #(= new %) old))) out-ch)
                           (close! out-ch)))
       (on-receive channel (fn [msg] (let [data (str (dispatch (read-string msg)))]
+                                     (println data)
                                      (send! channel data)
                                      (doall
                                       (map #(put! % data) (remove #{out-ch} (:out-chans @server-state))))))))))

  (case topic
    :get-user-bookmarks {:topic topic
                         :data (get-user-bookmarks (:conn @server-state) data)}
    :register {:topic topic
               :data (add-user (:conn @server-state) data)}
    :sign-in {:topic topic
              :data (verify-user (:conn @server-state) data)}
    :add-bookmark {:topic topic
                   :data (add-bookmark (:conn @server-state)

  ;; on first startup initialize datomic schema
  (init-schema (:schema @server-state))


  (get-all-users (:conn @server-state))

)
