Add error handling for API queries

The unknown API error reason will likely come up at some point, since I'm pretty sure they're not all in the map; I'll leave that block in for now, for easier debugging when we find those, and catch the others in a general null pointer exception handler.