client + server functionality