Nonlinear quantum model for the bosonic Josephson junction with one andtwo species