Adds a wrapper method to all API calls to provide better error handling on failed API requests