Moved ApiError to a model of its own