Simplify and consolidate API error handling.