Fixed API query issue