main file for server and client