API, pt II: Pagination

This adds pagination to the machines resource. Included in this PR is also a bonus commit that adds some testing of the serialization code.
We don't have a way for a user to control the page size, so until we add that, this will not change.