Updated server code