get json from endpoint