removed temp collections added queries for API