                            :email email
                            :role  (if administrator "admin" "user")})
                         (call-sql "get_all_users"))]
-    {:status  200
-     :headers {"Content-Type" "application/json"}
-     :body    (json/write-str all-users)}))
+    (data-response all-users)))
 
 (defn get-institution-users [request]
   (let [institution-id (Integer/parseInt (-> request :params :institutionId))

                                       "  The CEO Team")
                                  email email timestamp)]
        (send-mail [email] nil nil "Welcome to CEO!" email-msg "text/plain")
        {:status  200
         :headers {"Content-Type" "application/json"}
         :body    ""
         :session {:userId   user-id
                   :userName email
                   :userRole "user"}}))))

(defn logout [_]
  {:status  200
   :headers {"Content-Type" "application/json"}
   :body    ""
   :session nil})

(defn- get-update-account-errors [stored-email email password password-confirmation current-password]
  (cond (str/blank? current-password)

        current-password      (:currentPassword params)
        on-mailing-list?      (boolean (:onMailingList params))]
    (if-let [error-msg (get-update-account-errors stored-email email password password-confirmation current-password)]
      (data-response error-msg)
      (do
        (when (and (not (str/blank? email)) (not= email stored-email))
          (update-email user-id stored-email email))
        (when (not (str/blank? password))
          (call-sql "update_password" stored-email password))
        (call-sql "set_mailing_list" user-id on-mailing-list?)
        (data-response "")))))

(defn get-password-reset-key [request]
  (let [email (-> request :params :email)]
