reworked error api