Add error handling for API queries

This stringy series of if/else's may be better served with a:
```java
try {
// get and display error1
} catch (NullPointerException e) {
// display UI error
}