Updated api for mongoose