Updated PagesController edit method to use services