Added API for mongodb interaction. Fixed issues with mongoose and got models working. Refactored posts.js model to index.js to fix the routing.