Well typed http responses for javascript