Fix pages frontend, add tests