 
 (defn destroy-session
   [pool id & {:keys [immediately] :or [immediately true]}]
+  (s/validate SessionPool pool)
+  (s/validate s/Str id)
   (car/wcar (:redis-conn pool)
     (info (format "Destroying session %s..." id))
     (car/watch session-set-key)

   (s/optional-key :session) SessionInRedis
   (s/optional-key :node)    NodeInRedis})

(s/defn old->new-session-model :- SessionAndNode
  [session-model :- OldSessionViewModel]
  (merge
    (select-keys session-model [:id])

                          :current-url nil
                          :webdriver-id nil})

(s/defn ^:always-validate model->view-model :- SessionView
  [model :- SessionInRedis]
  (some->> model
           keywordize-keys
           (merge view-model-defaults)))

(s/defn ^:always-validate view-model-exists? :- s/Bool
  [pool :- SessionPool
   id   :- s/Str]
  (model-exists? (:redis-conn pool) SessionInRedis id))

(s/defn ^:always-validate view-model :- SessionView
  [pool :- SessionPool
   id   :- s/Str]
  (-> (model (:redis-conn pool) SessionInRedis id)
      model->view-model))

(s/defn ^:always-validate view-models :- [SessionView]
  [pool :- SessionPool]
  (let [redis-conn (:redis-conn pool)]
    (car/wcar redis-conn
      (car/return
        (map model->view-model (models redis-conn SessionInRedis))))))

(s/defn ^:always-validate view-model-ids :- [s/Str]
  [pool :- SessionPool]
  (map :id (view-models pool)))

(s/defn ^:always-validate view-model-by-webdriver-id :- SessionView
  "Return a view model with the corresponding webdriver id."
  [pool         :- SessionPool
   webdriver-id :- s/Str]
