initial unstable code to handle client requests