json encode pymongo cursor