finish replacement of aid with analysis_id