Add request cookie jar, check for statusCode errors

Added the use of cookies on the request.
Added a check for error responses before we try to parse the body which may not exist or contain HTML