         if req.method in ['GET', 'HEAD', 'OPTIONS']
             return next()
 
-        if yield accessService.check req.get 'X-Token'
+        if yield access.check req.get 'X-Token'
             return next()
 
         res

        else
            [req.body]

        yield geocacheService.upsertBulk models
        res.status 201
        res.send ''

    app.post '/geocache', async (req, res, next) ->
        yield geocacheService.upsert req.body
        res.status 201
        res.send ''

    app.put '/geocache/:gc/seen', async (req, res, next) ->
        now = Date.parse req.body
        yield geocacheService.touch req.params.gc
        res.status 200
        res.send ''

    app.delete '/geocaches', async (req, res, next) ->
        yield geocacheService.deleteAll()
        res.status 204
        res.send ''

    app.get '/gcs', async (req, res, next) ->
        res.set 'Content-Type', 'application/json'
        geocacheStream = yield geocacheService.getStream req.query, false
        geocacheStream
            .pipe JSONStream.stringify('[', ',', ']')
            .pipe res



    app.get '/geocaches', async (req, res, next) ->
        res.set 'Content-Type', 'application/json'
        geocacheStream = yield geocache.getStream req.query, true
        geocacheStream
            .pipe JSONStream.stringify('[', ',', ']')
            .pipe res

    app.get '/geocache/:gc', async (req, res, next) ->
        gc = yield geocache.get req.params.gc
        if not gc?
            res.status 404
            res.send '404 - Geocache not found\n'
        else
            res.header 'ETag', etag gc
            res.json gc

    app.head '/geocache/:gc', async (req, res, next) ->
        gc = yield geocacheservice.get req.params.gc
        if not gc?
            res.status 404
            res.send '404 - Geocache not found\n'
        else
            res.header 'ETag', etag gc
            res.end

    app.put '/geocaches', async (req, res, next) ->
