       (log (str "Sent to Tango Backend => " remote))
       (chsk-send! [:event-manager/query [[:competition/name :competition/location]]]))))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Application
+
 ;; TODO - since conn is set the read query will be run twice at start up - delay read or something.. 
 (def reconciler
   (om/reconciler
     {:state conn
      :remotes [:remote]
      :parser (om/parser {:read read :mutate mutate})
-     :send (sente-post) ;(fn [x y] (log (str "Sending to server: x" x " y: " y)))
+     :send sente-post ;(fn [x y] (log (str "Sending to server: x" x " y: " y)))
      }))
 
 ;; (om/add-root! reconciler

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Server message handling

(defn handle-query-result [d]
  (let [clean-data (uidb/sanitize d)]
     ;(log clean-data)   
    ;(log (apply str (map :competition/name clean-data)))
                                        ;(d/transact! (d/db conn) )
    (d/transact! conn [clean-data])
    (log (d/q '[:find [(pull ?c [:class/name]) ...]
                :where
                [?e :competition/name "Rikstävling disco"]
                [?e :competition/classes ?c]]
              (d/db conn)))
    ;(d/transact! conn [{:db/id 1 :competition/name (apply str (map :competition/name clean-data))}])
    ))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  [{:keys [state query] :as env} key params]
  {:value (do
            ;(log (str "Env: " env " --- Key : " key " --- Params" params))
            (log (str "Read app/competitions with query " query))
            (log (str "Key " key))
            (log (str "Env " env))
            (if query
              (d/q '[:find [(pull ?e ?selector) ...]
                     :in $ ?selector
                     :where [?e :competition/name]]
                   (d/db state) query))
            ) ;(log (str "Read Comp, state " state " , query" query))
   :remote true})

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mutate

(defmulti mutate om/dispatch)

(defmethod mutate 'app/add-competition
  [{:keys [state]} key params]
  (do
    {:value {:keys [:app/competitions]}
     :action (fn []
               (do
                 (log "Add Competition")
                 (d/transact! state [params])))}))

(defmethod mutate 'app/increment
  [{:keys [state]} _ entity]
