Chapter2 Example7: changed route definitions to a shorter API