changed routes to use controller actions to find pages.
created resourceful controller for posts.