Updating service to handle exceptions and return errors.