Add the API to the docs. 

And fix it

Thank @asaunier .