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

...onse is send to client
So I am just renaming afterProcess to beforeResponse, and keep the afterResponse.