handle 'fields' as a String as well as 'fields' as an array