Add serialization logic to controller.