added pages controller and tests