Advice from the startups that turned mistakes into opportunities for success