   [storage-spec entity]
   (-> storage-spec
       storage
-      (validate-entity entity)
+      (validate-existing-entity entity)
       (update-entity entity)))

                                  "entity")
      validated)))

(defn create
  "Creates a new entity"
  [storage-spec entity]
  (let [s (storage storage-spec)]
    (->> entity
         (validate-entity s)
         prepare-entity-for-save
         (create-entity s)
         prepare-entity-for-return)))

  (rename-keys entity {:user_id :user-id}))

(defn- validate-entity
  [storage schema entity]
  (let [validated (validate-model entity schema "entity")]
    (if (entity-exists-with-name? storage
                                  (:user-id validated)
                                  (:name validated))
