Refactoring: extract command from ApiCommandProducerImpl.