Improved controller initialization in cli and api