Changed javascript to only fetch each JSON file once