Updated main class to add server as well as client