Make the api more consistent
Add docs