updated readme, refactored api, added examples