Add relationship api logic