new api

This will fix issue #2.