A builder has been sentenced to 250 hours of community service for putting a home owner at risk following renovations to their house in Cardiff.