add collection API and a test case