                 (http/close hchan)
                 (catch Exception e
                   (error e "cannot handle incoming message"))))
-            (engine/request engine scenario ch))))
+            (engine/request engine
+                            (api/prepare scenario profile args)
+                            ch))))
 
    ;; defaults
    (GET "/" []      (redirect "/index.html"))

  (api/load! scenarios)
  (http/run-server (-> (api-routes scenarios engine)
                       (wrap-error)
                       (json/wrap-json-body {:keywords? true}))
                   opts))

(ns org.spootnik.fleet.http
  (:require [compojure.core                 :refer [routes GET POST PUT DELETE]]
            [clojure.tools.logging          :refer [error]]
            [clojure.pprint                 :refer [pprint]]
            [ring.util.response             :refer [response redirect]]
            [cheshire.core                  :refer [generate-string]]
            [ring.middleware.keyword-params :refer [wrap-keyword-params]]
            [ring.middleware.params         :refer [wrap-params]]
            [ring.middleware.json           :as json]
            [compojure.route                :as route]
            [clojure.core.async             :as async]
            [org.spootnik.fleet.api         :as api]
            [org.spootnik.fleet.engine      :as engine]
            [org.spootnik.fleet.history     :as history]
            [org.httpkit.server             :as http]))

(defn json-response
  [body]
