Adds a APIError type for more robust error handling