     ks)))
 
 (defn kv-get
-  "Returns (:ok value)"
-  [db k]
-  (let [[type value-atom] (get @db k)]
-    (if (= type :raw)
-      (list :ok @value-atom)
-      (list :error :type-mismatch))))
+  "Returns (:ok value), (:error :type-mismatch), or (:error :nil)"
+  [db k]
+  (if (contains? @db k)
+    (let [[type value-atom] (get @db k)]
+      (if (= type :raw)
+        (list :ok @value-atom)
+        (list :error :type-mismatch)))
+    (list :error :nil)))
 
 (defn kv-exists
   "Returns (:ok num) where num is the number of keys that exist"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Catch errors in kv_parse
;; Metadata for assigning types to db entries
;; Hashmap functions https://redis.io/commands#hash
;; Set functions https://redis.io/commands#set
;; Metadata for naming databases

;; LATER TODO
;; Add radix tree?

  (atom {}))

(defn kv-whole-map
  "Returns a hashmap snapshot of the entire database
  {k [type value] ...}"
  [db]
  (into {}
    (map
    #((comp vec list)
      (first %) ; key
      [(first (second %)) ; type
        (deref (second (second %)))]) ; value
    @db)))

(defn kv-value
