add server, client fixes, and tests