reworked api, tests, grunt task