Refactored routes to use MongoDB and Mongoose