Docs: render API documentation and tidy code