try:
    db.documents.insert(entity)
except ValidationError as ve:
    abort(400, str(ve))

@route('/documents/<_id>', method='GET')
def get_document(_id):
    entity = db.documents.find_one({'_id': _id})
if not entity:
    abort(404, 'No document with id %s' % _id)
return entity
run(host='localhost', port=8080)
python: how to store data in mongo via http put