Add some helper functions for JSON handling; simplify Expense routes.