      (try
        (handler request)
        (catch Exception e
-         (-> (resp/response (ui-template (exception->html e)))
+         (-> (resp/response (ui-template "Cauca UI" (exception->html e)))
            (resp/status 500)
            (resp/content-type "text/html"))
          ))))
 
  (def app
-   (-> #'main-routes
+   (-> #'main-handler
        (wrap-reload '[cauca.component.rest])
        catch-errors))
 
  (defn start-server! [] (run-jetty app {:port 8080
                                         :join? false}))
-
  (defn -main [] (start-server!))

     (include-js "/js/script.js")
     ]
    [:body
     [:h1 (link-to "/" "Cauca UI")]
     (seq body)
     ]))

 (defn main-page []
   (concat [[:h1 "Cauca Main"]])
   )
 
 (defn my-value-writer [key value]
  (if (or (= key :auctionDate) (= key :regDate) (= key :updDate))
    (str (java.sql.Date. (.getTime value)))
    value))

 (defroutes main-routes
   (GET "/" [:as {cookies :cookies}]
        (-> (main-page)
            ui-template))
   (GET "/courtauction/:id" [id]
        (let [dao-impl# (f/get-obj :courtauction-dao)
              ret-courtauction (first (.get-courtauction dao-impl# id))]
          (json/write-str ret-courtauction
                          :value-fn my-value-writer
                          )))
   (route/not-found "Page not found"))

 (defn exception->html [e]
   (concat

 (:use [hiccup core page-helpers]) 
 (:use [ring.adapter.jetty :only [run-jetty]])
 (:require [cauca.factory :as f]
           [cauca.log :as log]
           [compojure.route :as route]
           [compojure.handler :as handler]
           [clojure.data.json :as json]
