Added tests for refactored update and delete functions in FlagService.