Used request.json instead of request.form (apparently flask doesn't update request.form if Content-Type is application/json)