api split

I cut the api down into globals, methods and actual commands to use.