Updated server side code