search now takes page num instead of offset as argument
added viewshelper for pagination