Added code that converts json object to mongo object