Lay down the terms
Put time into your Terms and Conditions. Make sure the service you provide is well covered in them. Don't settle for general descriptions but make sure they are customized. When a dispute arises, the Terms and Conditions ensure that you cannot be accused of just about anything.
In the agreement between you and your client, make it clear what obligation you are making. A result obligation is riskier than an effort obligation. Make sure that the General Terms and Conditions are mentioned in the agreement. By signing the agreement or quotation, your client is thus familiar with the General Terms and Conditions.