Hi Jordi!
This is indeed a puzzling problem. To be honest, if someone just told me this instead my reading it myself on this forum, I would not have believe it. It is because backup files (i.e. The "odd" files Revit generates) have absolutely no effect (well, should have absolutely no effect, the theory goes) on the Revit model in the main file. There is simply no connections between those files, at least not one that Revit would establish.
The number of backups created for each file can be controlled via Options of the "SaveAs" command. The minimum number of backups is one, thus one cannot really disable backing up entirely.
Every time Revit is about to save a modified file, it first asks the Windows system to create a copy of the existing (and still unmodified, untouched since a previous save) file with the next consecutive backup name (e.g. [originalname].0001.rvt, etc.) The backup file gets created in the same folder. As soon as the system successfully finishes making the backup copy, Revit then proceeds with saving changes to the main file on disk. At no time before or after this operation there is any connection between those two files, except for the detail that one is created as a copy of the other one. Thus, assuming there were no "strange" access rights set for either the main Revit file, or the folder the Revit file and its copies are contained in, I really see no possible connection.
However, I do believe, Jordi, that you really experience what you have reported. Sometimes programming is just strange. This reminds me the famous story of a car owner who reported to GM that his Chevy did not start every time after he got out of a grocery store when he bought other than a plain vanilla ice-cream. With vanilla ice-cream, the car would start, with other ice-cream kind the car would refuse. Strange, huh? Well, there was a solution, after all. Of course, it was not about the ice-cream per se; it was about the time the customer needed to buy different kinds of ice-creams. The vanilla was by the register, so the customer returned to his car quickly.
I expect this "backup files" problem is something like that. There simply must be something else. The sheer existence of backup files having any effect on how Revit works or does not work just does not make any reasonable sense. Hopefully, you will be able to provide some code and explanation what your API application actually does. (I assume the errors occur when Revit is executing an external application.)
Thank you
Arnošt Löbel