Se api

Just for preview. Please don't merge it.
Please use an aid_ prefix for all functions in this file.