Did anybody see probable cause for a stop and search?
Parking on a street, solicitation already mentioned and possible drug transaction. This warranted an investigative stop. Identify, see if stories are consistent, run NCIC, call in drug dog,,, etc. That was for the stop, not the search. The arrest he was threatening before the gun was unfounded. He came to a conclusion without doing much of the above. Reasonable suspicion is 51% or greater liklyhood that a crime had been/was being committed and the people were committing the crime. If the driver was not on probation there is no crime for consorting with prostitutes or pimps. No money was seen exchanging hands, no act seen, no one saying that they were engaging in any acts. So if no one had warrants all should have been free to go. They could have given the driver a traffic citation depending on local laws.
For the search, they would have had to have consent, a warrant, a drug dog keying on the exterior or arrested the owner and itemized the contents in a secure area for anything to be used in court. It used to be legal to do a cursory search of the accessible areas to an occupant. The Supreme Court ruled this as Unconstitutional due to the officer no longer being in danger after the subject is removed from the vehicle. The search of the back seat was a violation of both occupants 4th Amendment. It was not in immediate reach of the driver, and the rear passenger was no longer able to access anything in the vehicle after removal. He could have searched the front with the driver still inside for his safety but would have to be able to articulate why the individual was simply not removed to ensure a safe environment for the officers.