   (let [{:keys [email password]} params]
     (if-let [user (first (call-sql "check_login" email password))]
       {:status  200
-       :headers {"Content-Type" "text/plain"}
+       :headers {"Content-Type" "application/json"}
        :body    ""
        :session {:userId   (:user_id user)
                  :userName email
                  :userRole (if (:administrator user) "admin" "user")}}
       {:status  200
-       :headers {"Content-Type" "text/plain"}
+       :headers {"Content-Type" "application/json"}
        :body    "Invalid email/password combination."})))
 
 (defn- get-register-errors [email password password-confirmation]

          (call-sql "update_password" stored-email password))
        (call-sql "set_mailing_list" user-id on-mailing-list?)
        {:status  200
         :headers {"Content-Type" "text/plain"}
         :body    ""}))))

(defn get-password-reset-key [request]

        password-confirmation (:passwordConfirmation params)]
    (if-let [error-msg (get-reset-password-errors password password-confirmation)]
      {:status  200
       :headers {"Content-Type" "application/json"}
       :body    error-msg}
      (if-let [user (first (call-sql "get_user" email))]
        (if (= reset-key (:reset_key user))
          (do
            (call-sql "update_password" email password)
            {:status  200
             :headers {"Content-Type" "application/json"}
             :body    ""})
          {:status  200
           :headers {"Content-Type" "application/json"}
           :body    (str "Invalid reset key for user " email ".")})
        {:status  200
         :headers {"Content-Type" "application/json"}
         :body    "There is no user with that email address."}))))

(defn get-all-users [_]
