Implementing adding entities and subscribing to the state events