Add Error handling to REST