added try/except block for json.loads(request.body)