Improve pages servlet

Change-Id: I5239808bc71441022b4b82e9d369866e9600bbfa