api fixed for raw query