Handle JSON response