refactored to use mongo, added routes