A petition alleging that a child is a child in need of services may be filed by a parent, a guardian, a legal custodian, a law enforcement officer, a guardian ad litem, an attorney who has knowledge of the facts alleged or is informed and believes that such facts are true, or a prosecuting attorney. Except when such petition has been filed by a prosecuting attorney, it shall not be accepted for filing unless the court or a person authorized by the court has determined and endorsed on the petition that the filing of the petition is in the best interests of the public and such child. When such petition is filed by a prosecuting attorney, the prosecuting attorney shall be authorized to conduct the proceedings on behalf of the state as parens patriae.