unmarshall json as types