fixed API query bug