Server Side Code based on Flask