Refactor API exception handling.
Always return array from apiError.
Merge branch 'api-exception-refactor' into develop