Add pagination and flash messages