Modelling occurrence and abundance of species when detection is imperfect