added api stuff to lib