Fix server deletion issues, add test refactoring

Change-Id: Ib57df38dd8bafb3e828db3abb5ce4a34fe7b5f71