serialize datetime objects to JSON using pymongo module.