Add paginate method for pagination