   drain: (fn) ->
     @_layer.drain fn
     return this
+
+  on: (eventId, handler) ->
+    @_server.on eventId, handler
+
+  emit: (eventId, data) ->
+    @_server.emit eventId, data
 
   ready: (callback) ->
     if @_server.listening

    log.moat 1
    res.status 500
    res.send {error: "Something went wrong on our end. Sorry!"}
    measure req, res

type.defineMethods

onTimeout = (req, res) ->
  res.status 408
  res.send {error: "Request timed out"}
  @emit "response", req
  measure req, res

measure = (req, res) ->
