Build the Json object with correct type