API refactored, example added, README updated