NVAPI session/profile ordering question...

Ok,
I have been able to use NvAPI_DRS_SetCurrentGlobalProfile() to change to a profile that works for my app, but obviously I don’t really want to change the global profile. So, my question is what is the proper way to do this. Do I do something like this:

app starts
init nvapi
create a session
find my profile by name
if (!found)
create a new profile and potentially a new app if needed
make the changes to my profile
save settings
close the session
… run my OGL code …
app ends

Do I need to reverse the last two items like this:

app starts
init nvapi
create a session
find my profile by name
if (!found) create a new profile and potentially a new app if needed
make the changes to my profile
save settings
… run my OGL code …
close the session
app ends