Search working
refactor pagination & searching; fix pagination bug