If base on ID record you dont have illegal record, you can challenge back the police which law the police are suspecting you have violated and what evidence leads him to draw such suspection. If he cannot answer you clearly, mark his police ID and complian.