Added guard for TopicID assignment.
Fixed table seeders.
Added guard for FlagID.
Reformatted and cleaned up code for ApiFlagController.
Full line coverage for ApiFlagController.