Corrected FlagController json output, added missing methods, fixed tests