Properly construct header fields from JSON
Generalize type transformations to pipes