                                  (when (satisfies? handlers/IHandlerResponse response)
                                    (handlers/handle-response response context)))))]
               (.add rspec ServerErrorHandler ehandler)))]
-    (.register chain ^Action (helpers/action on-register))))
+    (.register chain ^Action (ch/fn->action on-register))))
 
 (defmethod attach-route :default
   [chain [method & handlers-and-path]]


(defmethod attach-route :assets
  [^Chain chain [_ ^String path {:keys [dir indexes]}]]
  (.files chain (helpers/action
                 (fn [^FileHandlerSpec spec]
                   (.path spec path)
                   (when indexes (.indexFiles spec (into-array String indexes)))

(defmethod attach-route :prefix
  [^Chain chain [_ ^String path & handlers]]
  (let [callback #(reduce attach-route % handlers)]
    (.prefix chain path ^Action (ch/fn->action callback))))

(defmethod attach-route :scope
  [^Chain chain [_ & handlers]]
  (let [callback #(reduce attach-route % handlers)]
    (.insert chain ^Action (ch/fn->action callback))))

(defmethod attach-route :by-method
  [^Chain chain [_ handlersmap]]
  {:pre [(map? handlersmap)]}
  (letfn [(attach [^Context ctx ^ByMethodSpec spec [method handler]]
            (let [^Handler handler (handlers/adapter handler)
                  ^Block block (ch/fn->block #(.handle handler ctx))]
              (case method
                :get (.get spec block)
                :post (.post spec block)
