task5: add database output; modified REST api as AQL changes