             (map (fn [guid]
                    {:sid {:group_sid {:group_guid guid}}})
                  group_guids)))))
+
+(defn- get-token-info
+  "Returns the token info for the given token"
+  [context headers token-id]
+  (if (= "expired-token" token-id)
+    ;; echo-rest returns status code 400 for request with expired token
+    (ah/status-bad-request {:errors ["Token [expired-token] has expired."]})
+    (do
+      (ah/require-sys-admin-token headers)
+      (ah/status-ok (get-token-info-mock context token-id)))))
 
 (defn build-routes [system]
   (routes

            ;; echo-rest returns status code 400 for request with expired token
            (ah/status-bad-request {:errors ["Token [expired-token] has expired."]})
            (ah/status-ok (get-current-sids context token-id))))
        (GET "/token_info" {context :request-context headers :headers }
          (if (= "expired-token" token-id)
            ;; echo-rest returns status code 400 for request with expired token
            (ah/status-bad-request {:errors ["Token [expired-token] has expired."]})
            (do
              (ah/require-sys-admin-token headers)
              (ah/status-ok (get-token-info context token-id)))))))
    (GET "/availability" {context :request-context}
      {:status 200})))

(def registered-user-sid
  {:sid {:user_authorization_type_sid {:user_authorization_type "REGISTERED"}}})

(defn- get-current-sids
  "Returns the groups the user who owns the token belongs to"
  [context token-id]
  (let [{:keys [username group_guids]} (get-token-or-error context token-id)]
