                  (println "ERROR" fnkw "does not exist in the fmap"))
         dbfnprm (into edn-body (get-in fmap [fnkw :prm]))]
     (let [{sql :sql rows :rows} (dbfn dbfnprm)]
-      (end-response {:sql sql
-                     :rows rows}))))
+      (end-response {:sql sql :rows rows}))))
 
 (defn doreq-json [callback {:keys [params edn-body] :as prm}]
   (let [fnkw (:f edn-body)

                 (println "ERROR" fnkw "does not exist in the fmap"))
        dbfnprm (into edn-body (get-in fmap [fnkw :prm]))]
    (let [{sql :sql rows :rows} (dbfn dbfnprm)]
      (let [joe (json-response callback ["joj-foj" ["foj" "joj"] [] []])]
        (println "joe" joe)
        (let [res (json-response callback [{:sql sql :rows rows}])]
          (println "res" res)
          res)))))
#_
(defroutes myapp
  (GET "/"     [] "Show something")

  (GET "/"    req (file-response "public/html/index.html" {:root "resources"}))
  (PUT "/req" req (doreq req))
  (GET "/users/ids=:ids" req
    (let [query-string (:query-string req)
          callback (subs query-string (count "callback="))
          edn-body (conj {:f :users, :log true, :nocache true, :rowlim 1}
                         {:ids (->> req :params :ids read-string)})]
      (doreq-json callback {:edn-body edn-body})))

  (GET "/jsonreq/:search" req
    (let [query-string (:query-string req)
          callback (subs query-string (count "callback="))]
      (json-response callback ["joe-foo-stuff" ["foo" "joe"] [] []])))

  (route/files "/" {:root "resources/public"})
  (route/not-found "<h1>Page not foundX</h1>"))

