Crazy, man.
You're lucky that your efforts to indicate that you didn't consent to a search actually worked. I assume you guys hadn't been smoking yet, so the officer was precluded from saying that he had reason to believe that you guys were under the influence, but your friend's answers were suspicious enough that he might have been able to get away with searching your vehicle without consent.
Good work, though.
I strongly suggest that everyone watch the video I've linked below at some point. It covers three of the most common situations where you might find yourself faced with the possibility of a search and the way you should react.
Know your rights.
Busted: The Citizen's Guide To Surviving Police Encounters