add api methods in collection.js