Refactor the 'Relationships' resource