refactor code to work with rewrite end-points.
Merge branch 'dev' of github.com:iPlantCollaborativeOpenSource/DiscoveryEnvironment into dev