Updated the APIBuilder to work in typescript correctly

- Should be reverted to its old format when aliasing is added to typescript