created separate method for instantiating TCP server and added a test for it