A rental unit without a certificate of occupancy is illegal. Without a certificate, the landlord cannot collect rent. So you need to lawyer up and possibly withhold rent for both issues.
Typically a building permit is required if you decide to build, remodel, repair or demolish a structure on your property. We have a few exceptions for some general repairs.
The California Building Code (CBC) states that no building or structure can be used or occupied until a building official has issued a certificate of occupancy.
The inspector will look for such items as: paint and trim; fire protection requirements; stairs and handrails; roofs; gutters; accessory buildings; interior mechanical systems such as heat, electric and plumbing; interior and exterior structural soundness; and space requirements.