
219 P.3d 529 (2009)
2009-NMCA-121
Crystal HUNNICUTT, Plaintiff-Appellant,
v.
Regina Ryanczak SEWELL, Individually; and Regina Ryanczak Sewell, Attorney at Law, P.C.; Twelfth Judicial District Court; and Administrative Office of the Courts for the State of New Mexico, as primary contracting parties with Regina Ryanczak Sewell and/or Regina Ryanczak Sewell, Attorney at Law, P.C.; and Lynne Jessen, in her individual and official capacity; Ida Lujan, in her individual *530 capacity; Angela Adams, in her individual and official capacity; Mary Dale Bolson, in her individual capacity; John and Jane Does 1-10, in their individual capacities; John Doe 11; John Doe 12; and New Mexico Children, Youth & Families Department, Defendants-Appellees.
No. 28,343.
Court of Appeals of New Mexico.
September 3, 2009.
*531 Nancy L. Simmons, Law Offices of Nancy L. Simmons, P.C. Albuquerque, NM, for Appellant.
Michael Dickman, Santa Fe, NM for Appellees Twelfth Judicial District Court, Administrative Office of the Courts, John Doe 11, and John Doe 12.

OPINION
CASTILLO, Judge.
{1} Plaintiff appeals the district court's order dismissing the case against the Administrative Office of the Courts (AOC), the Twelfth Judicial District Court (TJDC), and John Does 11 and 12 (John Does) (collectively Defendants). Because we hold that each of these Defendants were entitled to judicial immunity, the complaint was properly dismissed as to them, and we affirm the district court.

I. BACKGROUND
{2} The following facts are drawn from the pleadings filed by Plaintiff. Plaintiff was the subject of an abuse and neglect proceeding that resulted in her placement with adoptive parents. Plaintiff's adoptive mother relinquished custody of Plaintiff to the Children, Youth and Families Department (Department) in October 2005. In May 2006, the Department initiated a petition for court-ordered family services on Plaintiff's behalf. The district court appointed an attorney (Attorney) to represent Plaintiff during that proceeding pursuant to a youth-attorney contract. In November 2006, Attorney moved to withdraw as Plaintiff's counsel, and the district court entered an order of withdrawal. On January 5, 2007, the matter was dismissed because Plaintiff reached the age of eighteen.
{3} Plaintiff originally filed a complaint for damages against Attorney and injunctive relief against AOC. She alleged breach of contract, breach of fiduciary duty, legal malpractice, violations of the Unfair Trade Practices Act, and abandonment. AOC filed a motion for summary judgment, which the district court granted with permission for Plaintiff to file an amended complaint within seven days. In her first amended complaint, Plaintiff sought damages against AOC and added defendants, including the Department, the TJDC, various state employees, and John *532 Does 1 through 10. Sometime later, Plaintiff filed a second amended complaint with additional claims that included yet more defendants-among them John Does 11 and 12.
{4} Specific to the appeal before us are the allegations regarding the youth-attorney contract and the allegations regarding constitutional violations. In her second amended complaint, Plaintiff alleged that she was a third-party beneficiary to the youth attorney contract and that TJDC and AOC breached that contract by failing to oversee Attorney's performance and by failing to ensure that substitute counsel was provided after Attorney was allowed to withdraw. As to the John Does, Plaintiff alleged that they violated her constitutional rights by failing to (1) arrange for competent counsel for Plaintiff, (2) oversee Attorney's representation of Plaintiff, and (3) secure substitute counsel for Plaintiff after Attorney was allowed to withdraw.
{5} Defendants filed a motion to dismiss the second amended complaint and argued that they were protected from Plaintiff's allegations by absolute judicial immunity and by qualified immunity or, in the alternative, that the complaint failed to state a contract claim against AOC and TJDC. After a hearing on Defendants' motion, the district court granted the motion and entered an order dismissing the complaint as to Defendants. Plaintiff appeals from that order.
{6} The district court's order did not affect Plaintiff's complaint against Attorney. Consequently, Plaintiff's current appeal relates only to the allegations brought against Defendants.

II. DISCUSSION
{7} On appeal, both parties maintain the positions that were developed below. Plaintiff's appeal is based on the two sets of allegations contained in the second amended complaint: the breach of contract claim against TJDC and AOC and the constitutional claims against John Does. Defendants maintain that they are immune from Plaintiff's allegations or, in the alternative, that the complaint failed to state a contract claim against AOC and TJDC. Because we conclude that Defendants are entitled to judicial immunity, we do not need to consider Defendants' remaining arguments.

A. Standard of Review
{8} "In reviewing a motion to dismiss for failure to state a claim under Rule 1-012(B)(6) NMRA ..., we take the well-pleaded facts alleged in the complaint as true and test the legal sufficiency of the claims." Envtl. Control, Inc. v. City of Santa Fe, 2002-NMCA-003, ¶ 6, 131 N.M. 450, 38 P.3d 891 (2001). We also review questions of immunity de novo. See Starko, Inc. v. Gallegos, 2006-NMCA-085, ¶ 11, 140 N.M. 136, 140 P.3d 1085 ("The applicability of qualified immunity is a question of law that we review de novo."); Candelaria v. Robinson, 93 N.M. 786, 789, 606 P.2d 196, 199 (Ct.App.1980) (identifying issues of absolute immunity as questions of law). We begin by examining whether Defendants are immune from suit: if immunity is applicable in the present case, it is a bar to suit and therefore a threshold issue. See Mitchell v. Forsyth, 472 U.S. 511, 525, 105 S.Ct. 2806, 86 L.Ed.2d 411 (1985) ("[T]he essence of absolute immunity is its possessor's entitlement not to have to answer for his conduct in a civil damages action."); Leach v. N.M. Junior Coll., 2002-NMCA-039, ¶¶ 11, 19, 132 N.M. 106, 45 P.3d 46 (explaining that the Eleventh Amendment and qualified immunity protect not only against liability, but from the burden of litigation).

B. Judicial Immunity
{9} Judicial immunity was developed to preserve the "autonomy and integrity of the judiciary" so that "persons who are integral to the judicial process [are] able to perform their functions without the intimidating effect of potential lawsuits." Collins ex rel. Collins v. Tabet, 111 N.M. 391, 398, 806 P.2d 40, 47 (1991) (internal quotation marks and citation omitted). Over time, judicial immunity has been extended to "various persons whose adjudicatory functions or other involvement with the judicial process have been thought to warrant protection from harassment, intimidation, or other interference with their ability to engage in impartial decision-making." Id. at 396, 806 *533 P.2d at 45. These persons are absolutely immune "from liability for their actions taken in performance of their roles as integral parts of the judicial process." Id. (internal quotation marks and citation omitted). Thus, in order to determine whether Defendants are entitled to absolute judicial immunity, we apply a functional test to determine whether the acts alleged by Plaintiff were judicial functions. See id. We recognize that there are two causes of actionbreach of contract against AOC and TJDC and constitutional claims against John Does. These claims arise from the same alleged functions: finding counsel, ensuring counsel's compliance with the youth-attorney contract, and securing replacement counsel after Attorney was allowed to withdraw. These functions, Plaintiff argues, are purely administrativenot judicialin nature. See Forrester v. White, 484 U.S. 219, 227, 108 S.Ct. 538, 98 L.Ed.2d 555 (1988) (stating that "[a]dministrative decisions, even though they may be essential to the very functioning of the courts, have not similarly been regarded as judicial acts"). We are not persuaded that the alleged functions in the present case are merely administrative acts.
{10} According to the Children's Code, NMSA 1978, §§ 32A-1-1 to -24-5 (1993, as amended through 2009), the appointment, oversight, and withdrawal of counsel are within the control of the court. Section 32A-3B-8(C) provides that "[i]n proceedings on a petition alleging a family in need of court-ordered services, the court shall appoint ... an attorney for a child fourteen years of age or older at the inception of the proceedings." In an abuse and neglect proceeding, the court is specifically required to oversee an appointed attorney's performance: "The court shall assure that... the child's attorney zealously represents the child." Section 32A-4-10(F). In addition, "[a]n attorney who has entered an appearance or who has been appointed by the court to represent a party in a children's court proceeding shall continue such representation until relieved by the court, unless a substitution of counsel is filed not less than fifteen ... days prior to the adjudicatory hearing." Rule 10-165(B) NMRA. Unless such substitution of counsel is filed, "no attorney or firm who has entered an appearance in a children's court proceeding may withdraw as counsel without a written order of the court." Rule 10-165(C). Thus, the court bears the statutory responsibility in children's court proceedings for appointing counsel, ensuring the competence of counsel, and for permitting counsel to withdraw. As a result, these are judicial and not administrative functions.
{11} Despite the language of the statutes and rules, Plaintiff argues that the alleged acts are not judicial functions because the Legislature appropriates funds to AOC, in collaboration with local district courts, to maintain the system. Specifically, Plaintiff contends that her allegations have no "direct relationship to the judge's order of appointment[] and cannot be properly considered a judicial function that would entitle [Defendants] to judicial immunity." In this way, Plaintiff argues that AOC is similar to the Public Defender Department, which receives appropriations to implement the public defender system. For support, Plaintiff cites State ex rel. Quintana v. Schnedar (Quintana), 115 N.M. 573, 855 P.2d 562 (1993). In Quintana, our Supreme Court considered whether the courts have the authority to order the Public Defender Department "to represent a particular `indigent' defendant when [that d]epartment decides that a particular defendant is not indigent and therefore not entitled to its legal services." Id. at 574, 855 P.2d at 563. Plaintiff states that Quintana stands for the proposition that "the Public Defender, not the court, was responsible for implementing the indigent defense system." Nowhere, however, does Quintana suggest that appointing and overseeing counsel is not a judicial function. In fact, Quintana does not consider the doctrine of judicial immunity at all. Further, Quintana appears to support Defendants' position. Although the Court acknowledged that the Public Defender Department is responsible for adopting standards for determining whether a defendant is indigent, the Quintana Court further concluded that the district courts are free to depart from those standards in order to "ensure the fundamental right to counsel through its inherent authority to safeguard *534 constitutional requirements." Id. at 578, 855 P.2d at 567. Thus, Quintana affirms that the district courts are responsible for safeguarding the constitutional right to counsel.
{12} Instead of relying on Quintana for direction with regard to judicial immunity, we look to Collins, which addresses the question of absolute judicial immunity and adjudicatory function in the context of the appointment of a guardian ad litem. Collins, 111 N.M. at 393, 806 P.2d at 42. The Collins Court concluded that a guardian ad litem benefits from absolute judicial immunity under certain circumstances, depending on the function. Id. at 395, 806 P.2d at 44. Absolute immunity attaches to a guardian ad litem when the appointment "contemplates investigation on behalf of the court into the fairness and reasonableness of the settlement in its effect on the minor." Id. If the appointment of the guardian "does not contemplate actions on behalf of the court but instead representation of the minor as an advocate, or if the guardian departs from the scope of appointment as a functionary of the court and instead assumes the role of a private advocate for the child's position, then the guardian is not immune." Id.
{13} In the present case, there is no allegation that Defendants departed from the scope of their duties as functionaries of the court. Plaintiff appears to argue that because she has alleged that Defendants acted unconstitutionally or breached the youth-attorney contract, the actions could not have been judicial and do not bear "any direct relationship to the judge's order of appointment." We are unpersuaded. When evaluating whether judicial immunity applies, we do not examine the allegations of improper or illegal conduct. Rather, we focus on the role that the individual claiming immunity played and evaluate whether that role was integral to the judicial process. See id. at 396, 806 P.2d at 45 (citing cases that utilize a "functional approach" to immunity); see also Cleavinger v. Saxner, 474 U.S. 193, 199-200, 106 S.Ct. 496, 88 L.Ed.2d 507 (1985) (noting that judicial immunity applies to judicial acts "however erroneous the act may have been, and however injurious in its consequences it may have proved to the plaintiff" (internal quotation marks and citation omitted)). Having already determined that Defendants' functions were judicial, we hold that Defendants are entitled to absolute judicial immunity.
{14} Plaintiff cites Mitchell v. Fishbein, 377 F.3d 157 (2d Cir.2004), but Plaintiff's argument related to Mitchell is unclear. Nevertheless, we observe that this case outlines two tests under which the question of judicial immunity may be evaluated. According to the Mitchell Court, a defendant is entitled to absolute judicial immunity when a defendant's role is "functionally comparable to that of a judge" or when a defendant's action is "integrally related to an ongoing judicial proceeding." Id. at 172 (internal quotation marks and citation omitted). We have already considered judicial function, and now we turn to evaluate whether Defendants' actions were integrally related to an ongoing judicial proceeding. "In order to be entitled to absolute immunity under this test, the official must be engaged in acts that are integrally related not simply to the judicial process in general but to a concrete judicial case or controversy." Id. at 174.
{15} In Mitchell, the plaintiffan attorneysued under 42 U.S.C. § 1983 for damages based on the defendants' refusal to recertify the plaintiff to act as court-appointed counsel for indigent defendants. Mitchell, 377 F.3d at 159. The Second Circuit Court of Appeals concluded that the defendants, who served on a committee to screen applicants, were not entitled to judicial immunity. Id. at 161, 172. Regarding the integrally related action analysis, the court determined that the defendants' function of formulating a list of qualified attorneys was "not related to any particular criminal prosecution" and that even the rejection of the plaintiff's particular application for certification did not affect a particular case, as the plaintiff was permitted to conclude the cases to which he had already been assigned. Id. at 174. As a result, the court determined that the defendants' function was not "integrally related to any specific judicial proceeding." Id.
{16} In the present case, Defendants' functions were inherently related to a *535 specific judicial proceeding. The district court had already appointed Attorney to represent Plaintiff. Plaintiff's claim was premised on acts and omissions related to that appointment, specifically that Defendants failed to provide Plaintiff with effective counsel and failed to provide replacement counsel after Attorney was allowed to withdraw from service. Thus, Plaintiff is arguing that Defendants were responsible for monitoring the effectiveness of Attorney and the status of Plaintiff's representation for the duration of the case. Unlike the Mitchell committee's obligation to provide a general list from which the court couldbut was not requiredto make selections at the appropriate time, Plaintiff contends that Defendants had an obligation in this judicial proceeding to take specific oversight actions. We conclude that Plaintiff's claims against Defendants were based on actions integrally related to Plaintiff's particular case and, therefore, under the second test in Mitchell, Defendants were entitled to judicial immunity.
{17} Based on either theoryjudicial function or integrally related actionswe conclude that Defendants are shielded from suit by judicial immunity for the actions alleged in Plaintiff's complaint.

III. CONCLUSION
{18} We affirm the district court.
{19} IT IS SO ORDERED.
WE CONCUR: JONATHAN B. SUTIN and LINDA M. VANZI, Judges.
