Validate API responses against types
We currently use type assertions to turn untyped JSON API responses into Typescript types but this does not actually verify the JSON against the given type. To avoid always having to handle schema mismatches downstream, we should validate API respones once when we turn the untyped into a typed representation.