refactor(rest) main.sendError -> sendError