change main function to run both server and client