Sort the rest API routes so that they are in a stable order.

Addresses issue #494.