API 1 support for SQL query