   (if-some [user-id (get-user-id user-id-cache email)]
     user-id
     (let [url (format "%s/users/?email=%s" api-root email)]
-      (if-some [users (-> (client/get url (assoc req-opts :connection-manager cm)) :body json/decode)]
-        (if-some [user-id (active-user users email)]
+      (let [users (-> (client/get url (assoc req-opts :connection-manager cm)) :body json/decode)]
+        (when-some [user-id (active-user users email)]
           (-> user-id-cache
               (swap! assoc email user-id)
-              (get email))
-          (throw
-           (ex-info "No active user with email provided" {:response-code 401})))
-        (throw
-         (ex-info "Down stream auth server timed out (Keycloak)"
-                  {:response-code 503}))))))
+              (get email)))))))
 
 (defn allowed-paths
   "Provided an email address from the authentication process dig out the

                                json/decode
                                (get "access_token"))]
       {"Authorization" (str "bearer " access-token)
        "Conternt-Type" "application/json"}
       (throw
        (ex-info "Down stream auth server timed out (Keycloak)"
                 {:response-code 503}))))))


(defn group-by-path
  "Get the group id (uuid) by using group path.

        (not (empty? (set/intersection possible-group-paths user-group-paths))))
      false)))

(defn add-user-to-group
  "Returns status code from Keycloak response."
  [request-headers api-root user-id group-id]
