 
             [clojure.data.json :as json]
             [cognitect.transit :as transit]
-            
+
+            [ring.util.response :as response]
             [immutant.web.async :as async-web]
-            [clojure.core.async :as async :refer [go go-loop <!]])
+            [clojure.core.async :as async :refer [go go-loop <!]]
+            [clojure.string :as s])
   (:import java.io.ByteArrayOutputStream))
+
+(def +encoding+ "utf-8")
 
 (defn ^:private data->response-fn [content-type]
   (case content-type

      (fn [data]
        (.reset out)
        (transit/write writer data)
        (.toString out "UTF-8")))))

(defn ^:private send-fn [content-type]
  (let [data->response (data->response-fn content-type)]

                           [#"^application/transit\+json"
                            #"^application/json"])
        seqs (:body req)

        poll-config (get-in req [:pepa/config :web :poll])
        db (:pepa/db req)
        bus (:pepa/bus req)
