         docType = @getDocType()
 
         viewName = "#{docType.toLowerCase()}/#{name}"
-        @db.query viewName, params, (err, body) =>
-            if err
-                callback err
-            else
-                results = []
+        PouchdbBackedModel.db.query viewName, params, (err, body) =>
+            if err
+                callback err
+            else
                 callback null, body.rows
 
     remove: (name, callback) ->
         docType = @getDocType()
         name = '_design/' + docType.toLowerCase() + '/' + name
-        @db.get name, (err, doc) ->
-            if err
-                callback err
-            else
-                @db.remove doc, callback
+        PouchdbBackedModel.db.get name, (err, doc) ->
+            if err
+                callback err
+            else
+                PouchdbBackedModel.db.remove doc, callback
 
     requestDestroy: (name, params, callback) ->
         [params, callback] = [{}, params] if typeof(params) is "function"

        view.reduce = reduce.toString() if reduce?

        viewName = "_design/#{docType.toLowerCase()}"
        @db.get viewName, (err, designDoc) =>
            unless designDoc?
                designDoc =
                    _id: viewName


    # Check existence of model in the data system.
    exists: (id, callback) ->
        PouchdbBackedModel.db.get id, (err, doc) ->
            if err and not err.status is 404
                callback err
            else if err?.status is 404
