changed api for registering a controller