Allowing the pages action to return a list or single page depending on index parameter