Server code for Flaggy