Made some changes on server-side

Made some steps to support data from MongoDB.