map json to case classes