Added functionality to extract header and body from response and added some unit tests