condensed code separated getJSON from addr and search functions