changed returned val from query from object to json so we can send it back