Upon failure to complete the work, failure to comply with all of the terms of any applicable permit, or failure of the completed improvements to function properly, the city may do the required work or cause it to be done, and collect from the permittee or surety all the costs incurred by the city, including the costs of the work, and all administrative and inspection costs.