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

...DataMiddleware class