Further work on diagnostics API