flask-collect implementation