 mongo = require 'mongodb'
 server = new mongo.Server 'localhost', 27017, {auto_reconnect : true}
+ObjectID = mongo.ObjectID
 
 Admin = module.exports.Admin = () ->
+   db = new mongo.Db 'stubserver', server
+   db.open () -> {}
+
    me = {
       qs: require 'querystring'
 
-      db: new mongo.Db 'stubserver', server
+      db: db
 
       RnR: require('../models/requestresponse').RequestResponse()
 

            if post
               signature.post = me.qs.parse post

         newRnR = me.RnR signature
         response.writeHead 204, {}
         response.end()


         response.writeHead 404, {'Content-Type': 'text/plain'}
         response.end()

      sendServerError : (response) ->
         response.writeHead 500, {'Content-Type':'text/plain'}
         response.end()

      sendSaveError : (response) ->
         response.writeHead 507, {'Content-Type':'text/plain'}
         response.end()

