Castle makes a crack about the name "Stanley" not being a unisex name. In fact, President Barack Obama's mother was named Stanley, after the Bette Davis character in the movie In This Our Life (who was also female).
At the crime scene at the episode's start, the Cecil Hotel is clearly shown in the shot behind Castle. The Cecil Hotel is one of LA's most notorious landmarks (having housed Richard Ramirez-"The Night Stalker"- during the time he was active) and actually the basis for "American Horror Story Hotel". Castle takes place in NYC not LA.