             success: -> res.send(200)
             error: -> res.send(404)
           }
-      # query destroy
-      else
-        @model_type.destroy req.params, (err) =>
-          return res.status(500).send(error: err.toString()) if err
-          res.send(200)
+    catch err
+      res.status(500).send(error: err.toString())
+
+  destroyByQuery: (req, res) =>
+    try
+      @model_type.destroy Utils.parse(req.query), (err) =>
+        console.log "destroyByQuery: #{util.inspect(req.query)}"
+
+        return res.status(500).send(error: err.toString()) if err
+        res.send(200)
     catch err
       res.status(500).send(error: err.toString())
 

    @[key] = value for key, value of options
    @white_lists or= {}

    app.get @route, @index
    app.get "#{@route}/:id", @show
    app.post @route, @create
    app.put "#{@route}/:id", @update
    app.del "#{@route}/:id", @destroy

  index: (req, res) =>
    try


  destroy: (req, res) =>
    try
      console.log "destroy: #{util.inspect(req.query)}"

      # TODO: is there a way to do this without the model? eg. transaction only (with confirmation of existence) - HEAD?
      if req.params.id
        @model_type.find req.params.id, (err, model) =>
