Use url var in all functions
Chg $.getJSON requests to also use error handler