moving query execution to the server side;