fixed parsing of the response from the server to the headers and content