server/modes: add types, fix compiler warnings for naming