fix query in api_server.py