Changed flask server to receive json requests