Finalize report generation functionality in backend