main server first init code