api to get and set flags and get flags metadata