The contract is not possible to be terminated. In case of really serious reason for leaving the apartment, the landlord can agree to terminate the lease but usually there is no deposit refund and all the rent must be paid until the last day of your stay.