INSTAOPS-644: added parsing for optional http server headers in response; code refactoring