Refactoring apis to use getCollection.