Refactoring routes to make it easier to unit test.
Removing log statements.
Cleaning up state URL's to closer reflect the actual REST API.