PEP-8 fixes for pages API.
Refactor into pages tests.