Implemented cursorId for automatically fetching all available data for queries.