changed pages controller to parse json