Return distinct results from the shared queries endpoint

This pull request also includes a more robust test for the shared_users property which adds more than one user to a shared_users relationship and also removes one too.