Completed client and server implementation