When you are running a business and working with customers, partners, shareholders, and anyone that requires agreement and contracts, you are most likely to face legal disputes or even business litigations at some point. But you can always avoid this if you have clearly understood everything that was written in any contracts you sign or any dealings you get into. Clearly define the services you offer and always keep a legal documentation of all projects, products, and services.
Most importantly, always be ethical in all your business practices. Be honest with your products and services, and always bear in mind that no matter how much profit you get, they are all not worth it if you are caught up in legal disputes that could take down your business. Also, invest in the proper training and education of your employees.