API rework (WIP)

THIS CODE IS NOT WORKING!!