some fixes to json sended in flask server