         res.status 500
         res.send ':-('
 
-    etag = (geocache) ->
-        return null if not geocache?
-        time = geocache.DateLastUpdate
+    etag = (gc) ->
+        return null if not gc?
+        time = gc.DateLastUpdate
         match = time.match /^\/Date\((\d+)-(\d{2})(\d{2})\)\/$/
         return null if not match?
         seconds_epoch = parseInt(match[1]) / 1000

JSONStream = require 'JSONStream'

module.exports = (services) ->
    accessService = services.access
    geocacheService = services.geocache

    app = express()


        if req.method in ['GET', 'HEAD', 'OPTIONS']
            return next()

        if yield access.check req.get 'X-Token'
            return next()

        res
