Added pagination and some missing functionality