adding API documentation and a few more tests