Added paginate method in models