Create MainPages controller