Fix JSON response to exclude null values