 
     app.get '/geocaches', async (req, res, next) ->
         res.set 'Content-Type', 'application/json'
-        geocacheStream = yield geocacheService.getStream req.query, true
+        geocacheStream = yield geocache.getStream req.query, true
         geocacheStream
             .pipe JSONStream.stringify('[', ',', ']')
             .pipe res
 
     app.get '/geocache/:gc', async (req, res, next) ->
-        geocache = yield geocacheService.get req.params.gc
-        if not geocache?
+        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 geocache
-            res.json geocache
+            res.header 'ETag', etag gc
+            res.json gc
 
     app.head '/geocache/:gc', async (req, res, next) ->
-        geocache = yield geocacheservice.get req.params.gc
-        if not geocache?
+        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 geocache
+            res.header 'ETag', etag gc
             res.end
 
     app.put '/geocaches', async (req, res, next) ->

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

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

        res

JSONStream = require 'JSONStream'

module.exports = (services) ->
    {access, geocache} = services

    app = express()

