modified insert/update logic for upstream logic and added route details table