db: store merge results, merge route implments JSON API