fixed some minor bugs and updated api documentation