bugfix: local variable 'data' referenced before assignment in ApiRequestDataMiddleware class