apiv2: remove some duplcation from api to apiv2