added basequery to api