Improves error handling.

Catches errors in a better fashion from errors in remote api calls.