Updated server code  + test client