added flask endpoint