[api] rewrite firmwares.json to use arrays, pdo and also stop being horribly awful code