proper handling of request and response headers