def create_game(teamOneId, teamTwoId): post_body = json.loads(request.data) teamOneScore = post_body.get('teamOneScore', 0) teamTwoScore = post_body.get('teamTwoScore', 0) game = Game(teamOneId=teamOneId, teamTwoId=teamTwoId, teamOneScore=teamOneScore, teamTwoScore=teamTwoScore) db.session.add(game) db.session.commit() return json.dumps({'success': True, 'data': game.serialize()}), 201