Added new changes on server side for saving data to mongodb.