refactor(rest) onPUT: error to top