handle API errors more gracefully than diving off a cliff