write response headers via server instead of directly tto channel
extract JsonRequestEvent and JsonResponseEvent interfaces allowing custom implementations