[WIP] Refactored API error objects