Make the command processing reusable across APIs