Added ServiceException
Updated upsert and delete services to validate agent.