parse data and insert to db