pagination, security and some allround fixes