moved the query HTTP to JSON helper