Add fairly complete API documentation