refactor(rest) sendError -> callback