             (channel-handler this (assoc data :tag tag))))
         (recur)))))
 
+(defn api--get-lines
+  [chan]
+  (util/send-request! :get "/api2/lines" nil chan))
+
+(defn api--get-stations
+  [chan line-no]
+  (util/send-request! :get (str "/api2/lines/" line-no "/stations") nil chan))
+
+(defui TestButton
+  Object
+  (render [this]
+    (let [{:keys [event-chan input-node]} (om/props this)]
+      (html
+       [:button {:on-click (fn [e]
+                             (let [new-title (.-value input-node)]
+                               (put! event-chan {:result :success :event-id :app/on-click :data new-title})))}
+        "update"]))))
+
+(def button-fn (om/factory TestButton))
+
+(defui TestInput
+  Object
+  (render [this]
+    (let [{:keys [ref title event-chan]} (om/props this)]
+      (html
+       [:input {:ref ref
+                :value (if (nil? title) "" title)
+                :on-change (fn [e]
+                             (let [new-title (-> e .-target .-value)]
+                               (put! event-chan {:result :success :event-id :app/update-title :data new-title})))}]))))
+
+(def input-fn (om/factory TestInput))
+
 (defui Root
   static om/IQuery
   (query [this]

      ;; watch channels
      (main-channel-loop this channels)
      ;; initialize
      (util/send-request! :get "/api2/lines" nil (:leaflet/lines channels))
      (util/send-request! :get "/api2/lines/24/stations" nil (:leaflet/stations channels))
      (om/update-state! this assoc :channels channels)))
  (componentWillUnmount [this]
    (debug "will-unmount"))
  (render [this]

       [:div
        [:div {:id "custom-control"
               :class "leaflet-control-layers leaflet-control-layers-expanded leaflet-control"}
         (input-fn {:ref "title" :title title :event-chan event-chan})
         (button-fn {:event-chan event-chan :input-node (-> this om/get-state :input-node)})
         [:div
          [:p (str "zoom: " (:zoom mapstate))]]]
        (leaflet-map-fn {:mapid "map"
