[api] move some validations to the relationship model