chore(rest): refactor rest