API documentation and cleanup