Do not use deprecated ApiMain::getFormats()

Use ApiModuleManager::getNames() instead.

Change-Id: Ic6a45aa15473bcf8d557a5daf91d26b34ce15ccc
Merge "Do not use deprecated ApiMain::getFormats()"