Use custom ListSerializer for pagination if required.

Closes #2327.