             [cerber.stores.token :as token]
             [cerber.helpers :as helpers]))
 
-(declare init-clients)
+(declare ->map init-clients)
 
 (defrecord Client [id secret info redirects grants scopes])
 
 (defrecord SqlClientStore []
   Store
   (fetch-one [this [client-id]]
-    (first (db/find-client {:id client-id})))
+    (->map (first (db/find-client {:id client-id}))))
   (revoke-one! [this [client-id]]
     (db/delete-client {:id client-id}))
   (store! [this k client]


(defn redirect-uri-valid? [client redirect-uri]
  (.contains (:redirects client) redirect-uri))

      (first result))))

(defn find-client [client-id]
  (if-let [found (and client-id (fetch-one *client-store* [client-id]))]
    (let [{:keys [approved scopes grants redirects]} found]
      (map->Client found))))

(defn purge-clients
  []
