add feature test, factor out server