The moral of this story is to get your tickets issued to the city code rather than a specific airport. Hence if you had got it ticketed to NYC (New York generically) you would not have had to pay the reroute fee. The same can apply to Chicago, San Francisco (which includes SFO, OAK, SJC if booked as the city), and so on...
(And remember to do it all open-dated!)