Flask implementation