Added commandendpoint and factory
made commandendpoint configurable