Se api

Just for preview. Please don't merge it.
Let's vote. :-) For clarity the two options are:
A. Check that *aid is NULL but also pass &aid to the release function which will set it to NULL
B. Don't care what *aid is and keep the release function is it is

I'm in favor of B.