made changes to javascript call to api collections