Updated to use mongodb instead of mock