Se api

Just for preview. Please don't merge it.
This function is only used from the self tests, perhaps it could be removed?