 
 (defn response-not-found
   [id]
-  (-> (str id " not found")
-      (map-response 404 id)))
+  (map-response (str id " not found") 404 id))
 
 
 (defn response-error

   resource. This is a 405 status code. Information from the request is used to
   provide a reasonable message."
  [{:keys [uri request-method] :as request}]
  (-> (str "invalid method (" (name (or request-method "UNKNOWN")) ") for " (or uri "UNKNOWN"))
      (ex-response 405 uri)))


(defn ex-bad-action

  "Provides an ExceptionInfo exception when the input is not valid. This is a
   400 status response. If the message is not provided, a generic one is used."
  [& [msg]]
  (ex-response (or msg "invalid request") 400))


(defn ex-not-found
  "Provides an ExceptionInfo exception when a resource is not found. This is a
   404 status response and the provided id should be the resource identifier."
  [id]
  (ex-response (str id " not found") 404 id))


(defn ex-conflict
  "Provides an ExceptionInfo exception when there is a conflict. This is a 409
   status response and the provided id should be the resource identifier."
  [id]
  (ex-response (str "conflict with " id) 409 id))


(defn ex-unauthorized
