refactor controllers and add failure