Add topology support

- add topology parameter to server class
- add test cases