Better response code handling and parsing