make report using flask instead of js