Fixing a mongoose 3.7.x compatablility issue in the API