Refactored the getJSON methods to put their logic in the correct places