code to run server (ported to bits::server namespace)