 
 (def base-path "/applications")
 (def storage (get-container))
+
+(defn- read-json-str [data]
+  "try to read json data, and error with the bad json if there's an error"
+  (try
+    (json/read-str data)
+    (catch Exception e
+      (throw (IllegalStateException. (str "Error processsing " data ":\n" (.getMessage e)))))))
 
 (defn- coalesce-map [map1 map2]
   "recursively merge maps"


(defn- app? [data]
  "returns true if the json provided is of type application"
  (= "application" (get-type data)))

(defn- path->full-path [path]
  "adds the base path back in"

        item (.get-item storage full-path)
        json (if (empty? item)
               {}
               (walk/keywordize-keys (read-json-str (:value item))))
        new-json {:description description
                  :values {(keyword good-envt) {:value value :source path}}
                  :type "token"}
