Moulding a cap over the MEMS device