Update collectionapi.js

Had to add accept headers, also.