Writing middle ware for parsing nav data