fixes #3138 . Update istatistics after operation is run and  before resp...

...onse is send to client
I think it is better to update stats before sending response. We can keep afterResponse() and add just an beforeResponse() not to violate open-closed principle.