Hereafter all persons to whom bail has been denied or who are confined for failure to give bail, may have the benefit of a writ of habeas corpus for the purpose of being admitted to bail or having the bail reduced, and the court or judge shall, upon habeas corpus, review the proceedings or action of a committing magistrate.
NMS § 44-1-23