Improved api

Posting it as a PR for public comment.