Do not use deprecated ApiMain::getFormats()

Change-Id: I0dc6141567a35c51b65ddcc04a5e2777b97fb350