Add functions for API
Bring back API

Do not bother attempting to use yet