implemented server and client