Add server mode to unittest