moved mutual-like code to apisrv