   
   (OPTIONS [(str url-prefix "/trackers/:ids/events") :ids #"([0-9]+,?)+"] [ids]
        (-> #'success-handler
-           (wrap-cors-headers "GET")
+           (wrap-cors-headers "GET" )
            (wrap-request-logger)))
   (GET [(str url-prefix "/trackers/:ids/events") :ids #"([0-9]+,?)+"] [ids]
        (-> (fn [request] (client-api/fetch-events (merge request {:tracker_ids ids})))


;; TODO do some macro thing that creates automatically OPTIONS route
(defroutes api-routes
  (OPTIONS (str url-prefix "/ping") []
       (-> #'success-handler
           (wrap-cors-headers "GET")

  
  (OPTIONS (str url-prefix "/events") []
       (-> #'success-handler
           (wrap-cors-headers "GET" "POST")
           (wrap-request-logger)))
  (GET (str url-prefix "/events") []
       (-> #'client-api/fetch-events
           (wrap-cors-headers "GET" "POST")
           (wrap-request-logger)))

  ;; Tracker-API
  (POST (str url-prefix "/events") []
        (-> #'tracker-api/handle-create-event
            (wrap-request-logger)
            ))
  )
