adding rest error support