Add error handling for API queries

I'd rather not put that in exception handling, as a null here is an expected result.