Added id everywhere and moved some init code in server.