Added code to save routes data to JSON