Maybe it would make sense to remove the collect endpoint from rest.js, and just have this TestUtil function call the collect API function directly? That way, we can avoid having that function used for test purposes in there