Add pages controller
Refactor pages tests