AFAICT from reading the code, we are creating a new record for each API operation, and then each record stores a list of commands, but we actually reset this list and only add one command. Is there a reason for that? Can we document it? More in general, can we document the overall idea?