Section 31 shall, so far as they are applicable to them extend and apply to justices of the peace, coroners and prosecutors in the public interest.