writes directory or artists to JSON