Use rfg-api module
Let rfg-api handle markup generation
Write HTML file if none exists