Revert "let ServerFactory return unique ptr instead of raw ptr"

This reverts commit cc7c6b9ece19169b65c94c2b09c75ae5d667800e.