added orderd sql query to query api call