parsing headers function changes api client