Updating infinite scroll example code to use new API