Refactored rest errors