Improve api documentation, add example file