Fix how API response is read