Update api.php

Fixes division by zero and empty array for https://github.com/viion/XIVPads-LodestoneAPI/issues/40

Caused by no legacy category for non legacy characters.