Add a hook to server response

Please, review the hook to server response and merge it if you think it is correct.