Adding pagination and count