base code for server side of unit