server: refactor add