Changed getJson to return the json instead of writing it