Se api

Just for preview. Please don't merge it.
To set the pointer to NULL, we need to pass "&aid" to release function, which is a little strange. Do you think this is ok? If yes, I can apply it. Or we can vote here if we need this kind of checks ?