now catches API request errors