    [kixi.hecuba.storage.sha1 :as sha1]
    [kixi.hecuba.web-paths :as p]
    [kixi.hecuba.data.users :as users]
-   [kixi.hecuba.data.entity :as entity]))
+   [kixi.hecuba.data.entities :as entities]))
 
 (def ^:private entity-profiles-resource (p/resource-path-string :entity-profiles-resource))
 

          method       (:request-method request)
          route-params (:route-params request)
          entity_id    (:entity_id route-params)
          entity       (entity/get-by-id session entity_id)]
      (case method
        :post (not (nil? entity))
        :get (let [items (db/execute session (hayt/select :profiles (hayt/where [[= :entity_id entity_id]])))]

          username   (sec/session-username (-> ctx :request :session))
          profile_id (sha1/gen-key :profile profile)]
      (when (and entity_id timestamp)
        (when (entities/get-by-id session entity_id)
          (let [query-profile (-> profile
                                 (assoc :user_id username)
                                 (update-stringified-lists
