updated repository tests to use api's for dependent entities
Merge pull request #1359 from sghai/repo-test

Updated repository tests to use api's for dependent entities