server fix some warnings and fix some FIXME and TODO