update API and document it in readme