 
   (POST "/validate" req
     (if-let [data (:body req)]
-      (safe #(write-str (validation data)))
+      (safe #({:headers {"Content-Type" "application/json"} :body ( write-str (validation data) ) }))
       {:status 400 :body "Must provide occurrence json of data as input."}))
 
   (GET "/fix" {params :params}

(defn safe
  ""
  [fun] 
   (try (fun)
    (catch Exception e 
      (do 
        (.printStackTrace e)

              {:status 200 :body "ok"})
            {:status 200
             :headers {"Content-Disposition" (str "attachment; filename=\"dwc." to "\"")
                       "Content-Type" (get ctypes (keyword to ))}
             :body (convert {:from from :to to :source url :fixes (:fixes params)})})
          {:status 400 :body "Must provide 'to' parameter of the output format."})
        {:status 400 :body "Must provide 'from' parameter of the input format."})
