added more server and client functionality