 routeMatcher = new vertx.RouteMatcher
 
 routeMatcher.get '/routes', (req) ->
+  req.response.putHeader 'Content-Type', 'application/json; charset=utf8'
   req.response.setChunked true
   eb.send 'reitti.geocode', query: req.params().from, (from) ->
     eb.send 'reitti.geocode', query: req.params().to, (to) ->

      req.response.end()
      
routeMatcher.get '/autocomplete', (req) ->
  eb.send 'reitti.searchIndex.find', query: req.params().query, (data) ->
    req.response.end JSON.stringify(itm.name for itm in data.results)


        req.response.end JSON.stringify(from: !!from, to: !!to)

routeMatcher.get '/address', (req) ->
  req.response.putHeader 'Content-Type', 'application/json; charset=utf8'
  eb.send 'reitti.hsl.reverseGeocode', query: req.params().coords, (address) ->
    if address
      req.response.end JSON.stringify(address)
