Add pagination support in frontend.