add connection to mongodb
Updated controller
Updated templates