Add IORef to know the state of the service.