refactor ApiConsumer