added a bunch of stuff to api2

not all functions are tested