                    "Content-Disposition" (str "attachment; filename="
                                               (prepare-file-name (:name project-info) "sample")
                                               ".csv")}
-         :body (str/join "\n" (conj data-rows (str "\uFEFF" headers-out)))})
+         :body (str/join "\n" (cons headers-out data-rows))})
       (data-response "Project not found."))))

                   "Content-Disposition" (str "attachment; filename="
                                              (prepare-file-name (:name project-info) "plot")
                                              ".csv")}
         :body (str/join "\n" (conj data-rows (str "\uFEFF" headers-out)))})
      (data-response "Project not found."))))

(defn- get-ext-sample-headers

                                       (get-ext-plot-headers project-id)
                                       (get-ext-sample-headers project-id)
                                       (map question-key sample-value-group))
            headers-out        (->> text-headers
                                    (map #(-> % name csv-quotes))
                                    (str/join ",")
                                    (str "\uFEFF")) ; Prefix headers with a UTF-8 tag
            data-rows          (map (fn [row]
                                      (let [value           (tc/jsonb->clj (:value row))
                                            ext-plot-data   (tc/jsonb->clj (:ext_plot_data row))
