added pages controller
added some tests