When Carole King and Gerald Goffin wrote "Up on the Roof" they certainly were not thinking about one of the most famous roofs in New York City – the one atop the Ansonia Hotel, back in its early years.

That's where the hotel's builder, owner and most famous resident, W. E. D. Stokes, maintained a small farm. But a chick-chick here and an oink-oink there did not go over well with other residents or with neighbors. Finally the city's board of health paid a visit and in 1907 Stokes was charged with violating the sanitary code by keeping pigs and game on the roof. According to the New York Times (May 19, 1926), he settled the case by giving the animals to the Central Park menagerie.

The following story, from the New York Times, is an amusing "Great Escape" version of the city's first visit to check on the farm. It mentions only the pet pig of W. E. D. Stokes Jr. and four geese. (The reference to the boy as "little Stokes" is a bit misleading. He was less than two months shy of his 12th birthday.) However, the story also served to blow the whistle on Stokes. His son soon picked up a new hobby involving short wave radio and a station the boy established on the Ansonia roof.

New York Times, November 12, 1907
W. E. D. Stokes, owner of the Ansonia apartments, at Broadway and Seventy-third Street, spent a busy hour yesterday when he heard that complaint had been made against him to the Board of Health for harboring “pigs and geese” on the roof of the big building in violation of the Sanitary Code.

Mr. Stokes did have a pig and four geese on the roof, but they were all in safety before the arrival of the man sent by Chief Sanitary Inspector Raynor to investigate the sky farm.

The pig is called Nanki-Poo and is the adored pet of Mr. Stokes’s son, William Earle Dodge Stokes Jr. Ever since last summer the little animal has had an ideal home amid the chimney pots of the Ansonia. Four wild geese with clipped wings were recently added to the establishment to keep the pig company. For hours little Stokes would romp with his pets, and Nanki was especially dear to the boy, as he had raised him from the milk-bottle stage.

All was serene until yesterday, when the complaint was lodged with the Board of Health. But Mr. Stokes heard a half hour in advance that his farm was to be raided. He had an office on the sixteenth floor of the apartment house, but when the safety of his son’s pig was threatened, all business was dropped. He dashed up the narrow stairway in the twilight, followed by his son, and made a brief survey of the roof. Nanki-Poo, unconscious of his peril, was noisily devouring pap. The four wild geese were dining sumptuously on cracked corn.

Mr. Stokes sent for John, a Swedish servant.

“The Board of Health is after the boy’s pets,” said Mr. Stokes. “We must get the geese and the pig out of the way before the inspector comes. Take them down to the basement in the freight elevator.”

Then Mr. Stokes directed the retreat. This was accomplished with some difficulty. The roof of the Ansonia is a labyrinth of cornices, skylights, and chimneys. It was growing dark, and the steam from an exhaust pipe obscured the scene of action in a thoroughly Wagnerian fashion.

“Get the pig first!” commanded Mr. Stokes. John and the boy pursued Nanki-Poo through a cloud of steam and loud squeals announced the capture. Nanki struggled frantically against John’s embrace.

“Put your hand over his snout,” said Mr. Stokes, laughing.

John obeyed, but nevertheless Nanki was able to record his squeals of protest until he disappeared in the freight elevator to the safety of the basement.

When John returned, another herculean task was waiting – the capture of the four geese. They were wild in more senses than one. They fought valiantly and hissed in their fright. Finally they joined Nanki in the warm recesses of the boiler room.

Then the Sanitary Inspector arrived. He was received courteously, and Mr. Stokes escorted him to the deserted roof.

“I want you to see for yourself that there are no animals on the roof,” Mr. Stokes explained.

The representative of the Board of Health acknowledged his error, made a caustic remark about “busybodies who report things,” and departed. Then the father and son enjoyed the incident to their hearts’ content.

To a Times reporter Mr. Stokes explained the presence of the animals as follows:

“Last summer my boy and I were motoring on Long Island. We stopped at a farmhouse and my son made the acquaintance of this baby pig. The pig’s mother had died and the boy wanted him for a pet. We brought him to town in the motor, and fed him for weeks on milk from a bottle. Then from the same farmer we bought these wild geese to relieve the pig from boredom. Everything was quite sanitary, and the boy had great fun playing with his pets. It merely shows how a most innocent incident can be misconstrued, but I laughed heartily over a big city department pursuing a boy’s pet pig.”

Russel Raynor, who directed the investigation, said: “My inspector reports that Mr. Stokes has been misrepresented, and that there was no violation of the Sanitary Code. There were no animals on the Ansonia roof.”