If you are using C, make sure you use the iControl .Net assembly as it makes coding a lot easier. It can be downloaded from the "iControl Assembly" labs project.
As for saving config, keep in mind that iControl calls are only written to memory. It is a fairly expensive process to write the configuration to disk so we opted to leave that to developer. The UI does to a flush to disk on each change but it doesn't have the requirement of making many calls per second.
To save the configuration look at the System.ConfigSync.save_configuration() method. You'll might want to look at the synchronize_configuration() method if you want to ensure the configs are sync'd between a HA group.
-Joe