Move EnumErrorCode to the API