Switch to do query from pre-generated json