      :plotId        plotId
      :geom          (tc/jsonb->clj geom)
      :extraPlotInfo (clean-extra-plot-info extra_plot_info)
-     :samples       (prepare-sample-object plot_id project-id)}))
+     :samples       (prepare-samples-object plot_id project-id)}))
 
 (defn get-project-plot [{:keys [params]}]
   (let [project-id (tc/str->int (:projectId params))
         plot-id    (tc/str->int (:plotId params))]
-    (data-response (build-plot-object (first (call-sql "select_plot_by_id"
-                                                       project-id
-                                                       plot-id))
-                                      project-id))))
+    (data-response (prepare-plot-object (first (call-sql "select_plot_by_id"
+                                                         project-id
+                                                         plot-id))
+                                        project-id))))
 
 (defn- unlock_plots [user-id]
   (call-sql-opts "unlock_plots" {:log? false} user-id))

                                 (:plot_id plot-info)
                                 user-id
                                 (time-plus-five-min))
                       (build-plot-object plot-info project-id))
                     "done"))))

(defn get-plot-by-id [{:keys [params]}]

  (or (dissoc (tc/jsonb->clj extra-plot-info) :gid :lat :lon :plotid)
      {}))

(defn- prepare-plot-object [plot-info project-id]
  (let [{:keys [plot_id center flagged plotId geom extra_plot_info]} plot-info]
    {:id            plot_id
     :projectId     project-id ;TODO why do we need to return a value that is already known
