making celery task and view page for analytics the same function