api2: refactor out covariance sigma vector determination
apiv2: refactor to be a little nicer