key_commit: Fixed another bug witht he apiinvoices sqlobject