title: No converter found for return value of type - Spring Rest API with db call
body: <p><strong>EDIT: I figured out how to fix this and posted it in an answer below.</strong></p>
  
  <p>I'm trying to create an API that queries a db and returns two values. I know the db query works because I can see it spit the values out to the console. But when I execute it, I get this error: No converter found for return value of type: class hello.GetPatientInfo</p>
  
  <p>Here is my controller code:</p>
  
  <pre><code>package hello;
  
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.ResponseBody;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  public class PatientInfoController {
  
      @RequestMapping("/patientinfo")
      @ResponseBody
      public GetPatientInfo getPatientInfo (@RequestParam String ssnum){
          return new GetPatientInfo(ssnum);
      }
  }
  </code></pre>
  
  <p>Here is my class for it:</p>
  
  <pre><code>package hello;
  
  import com.automation.dataprovider.DatabaseFunctions;
  
  public class GetPatientInfo {
      DatabaseFunctions db = new DatabaseFunctions();
      private final String pname;
      private final String patno;
  
      public GetPatientInfo(String ssnum){
          this.patno = getPatNo(ssnum);
          this.pname = getPname(ssnum);
  
      }
  
      public String getPatNo(String ssnum){
          String query = "SELECT PATNO FROM lib.PATIENTS WHERE SSNUM = '" + ssnum +"'";
          String patno = db.returnSingleValue(query).toString();
          System.out.println(patno);
          return patno;
      }
  
      public String getPname(String ssnum){
          String query = "SELECT PNAME FROM lib.PATIENTS WHERE SSNUM = '" + ssnum +"'";
          String pname = db.returnSingleValue(query).toString();
          System.out.println(pname);
          return pname;
      }
  }
  </code></pre>
  
  <p>I'm sure I'm doing something fundamentally wrong since I've never created an api before but I'm just not getting anywhere quick. Any help would be greatly appreciated. </p>