Created main for server and client