Handle parsing of JSON response