Updated Server code