#2 added middleware for storing data about requests. also added support of this middleware at client side