More api key file error checking