Updated routes code with new ensure* interface.