New api

closes #7