Update api.php

Lots of improvements for the launch of the new lodestone. Precaution checks in place for when character page does not return a character name.