There are several things you can do such as:
- Error catching
-> If no errors are caught then its safe to assume things worked out
- Read API calls afterwards
-> This will allow you to check the read data against certain conditions
Generally speaking though, the logic you're trying to do doesn't make much sense. The API touches only what its meant to and nothing else. There's no way to ensure that the correct configurations were made because it is not possible to define "correct" in terms of code, especially since the whole point of the script is to change the configurations and thus the definition of "correct" changes as well. If the script is meant to change configurations, that's exactly what it will do. Nothing else.