Added some basic error handling to the doAPIGet method.