added error handling for sqwiggle api call