                                 :version *version*
                                 :success true}))})
 
+(defn- create-application
+  [req]
+  (let [body (cheshire/parse-string (slurp (:body req)))
+        result (persistence/create-application body)]
+    (response (cheshire/generate-string body) json-content-type 201)))
+
+(defn- list-applications
+  []
+  (prn "LIST APPLICATIONS"))
+
+(defroutes applications-routes
+
+  (POST "/" req
+        (create-application req))
+
+  (GET "/" []
+       (list-applications)))
+
 (defroutes routes
   (context
    "/1.x" []

(ns onix.web
    (:require [compojure.core :refer [defroutes context GET PUT POST DELETE]]
              [compojure.route :as route]
              [compojure.handler :as handler]
              [ring.middleware.format-response :refer [wrap-json-response]]

        [] "pong")

   (GET "/status"
        [] (status))

   (context "/applications"
            [] applications-routes))

  (route/not-found (error-response "Resource not found" 404)))

(def app
  (-> routes
