 
 (defn query-from-params
   [ent params]
-  (let [where-clause (reduce params-to-where {} params)] (select ent
+  (let [where-clause (reduce params-to-where {} params)] 
+    (select ent
             (where where-clause))))
 
 (defn- kafka-config


(defn event-routes
  [config [type project]]
  (println type project)
  (let [msgs (kafka-stream (:zookeeper config) type project)
        db-ent (ent config type project)]
    (GET (str "/events/" type "/" project) [:as req] (handle-request msgs db-ent type project))))


(defn- streaming-response
  [msgs {:keys [params] :as req}]
  (let [in-chan (chan)
        out-chan (->> (sub msgs true in-chan)  
                      (map< kafka-json-string-to-map)
                      (map< (comp #(str % "\n") generate-string)))]
    (with-channel req channel
      (send! channel (resp-ok (<!! out-chan) stream-mime) false)
      (let [writer (go-loop [msg (<! out-chan)]
                            (send! channel (resp-ok msg stream-mime) false)
                            (recur (<! out-chan)))]
        (on-close channel (fn [status] 
                            (close! writer) 
                            (close! in-chan)
                            (close! out-chan)))))))

(defn handle-request
  [msgs db-ent type project]
