Query method now returns and array if the query is succesfull