
362 P.2d 523 (1961)
68 N.M. 373
Paul CAMPBELL, Plaintiff-Appellee,
v.
Porter A. SMITH, Bessie Smith, Robert Smith, John M. Pettis, Grace Pettis, Ury Ealum and Betty Jo Ealum, Defendants-Appellants.
No. 6778.
Supreme Court of New Mexico.
May 9, 1961.
Rehearing Denied June 26, 1961.
*524 LaVor Burnham, Aztec, Standley & Kegel, Santa Fe, for appellants.
Morgan & Cain, Farmington, for appellee.
NOBLE, Justice.
Appellant appeals from a jury verdict of $14,000 in an action to recover the value of services rendered and benefits accruing to appellants by reason of appellee's labor, knowledge or services in the construction of a drive-in theatre at Aztec, New Mexico.
Appellee was employed by appellants, a partnership, as manager of the Rincon drive-in theatre at Aztec at a weekly salary of $70 and a percentage of the annual profits from operation of the theatre. Appellants determined to build a second drive-in theatre and requested appellee to handle the construction of the theatre. The complaint alleges appellee's employment in the management of the Rincon theatre and that because of his knowledge of the theatre business he was requested to handle the construction, operation and management of the new theatre. Appellants agreed to pay all costs of construction and equipment. It is further alleged that appellants informed appellee that he was to be in charge of and responsible for the construction of the theatre; that he was to purchase all equipment and supplies; to effectuate all possible savings in the construction and to employ all necessary labor. It is further alleged that appellee was to have sole supervision and direction of the construction and of all personnel both in construction and in the management of the theatre without interference by appellants. The complaint alleged that as consideration for appellee's services both in the construction and management of the second theatre he was to receive a salary of $30 per week for management of the new theatre when completed and a share of its annual net profits. He was not paid a wage or salary in connection with the second theatre during its construction. Construction was commenced in March 1957 and completed and the theatre opened for business on May 1, 1958. Appellee managed both theatres until August 1958 when he quit because of a disagreement with appellants over his sole control of employees. This action followed to recover the value of his services in the construction of the second theatre.
The answer alleged the failure of the complaint to state a cause of action but a ruling of the trial court was not invoked on that motion or allegation. It is urged on appeal that the complaint fails to state facts upon which relief can be granted, in that facts are alleged showing appellee to have been an independent contractor; that he failed to allege a contractor's license as required by § 67-16-14, N.M.S.A. 1953 Comp., and that the court was therefore without jurisdiction. We are asked to determine that question raised for the first time on appeal.
Appellee, on the other hand, asserts that the claimed error cannot be urged on appeal since a ruling of the trial court was not invoked. It is likewise urged that the testimony adduced at the trial shows the relationship to have been that of master and servant rather than one of an independent contractor.
Failure of a complaint to state a cause of action is jurisdictional and may be raised for the first time on appeal. Phillips v. Allingham, 38 N.M. 361, 33 P.2d 910; Lasko v. Meier, 394 Ill. 71, 67 N.E.2d 162. See also Salter v. Kindom Uranium Corp., 67 N.M. 34, 351 P.2d 375. L. & B. Equipment Co. v. McDonald, 58 N.M. 709, 275 P.2d 639 is distinguishable. The statute applicable there did not prevent enforcement for violation of the license requirement.
However, when failure of a complaint to state a cause of action is raised *525 for the first time on appeal or where the party goes to trial on the merits after an adverse ruling on a motion to dismiss, we must then test the sufficiency of the complaint in the light of the doctrine of aider by verdict. Phillips v. Allingham, supra. Aider by verdict is:
"The presumption of the proof of all facts necessary to the verdict as it stands, comes to the aid of a record in which such facts are not distinctly alleged." Black's Law Dictionary (4th Ed.)
This is not a case where facts are imperfectly or not distinctly alleged. Appellee alleged facts showing him to meet the test of an independent contractor. If evidence was admitted without objection showing a different status, that does not supply an allegation imperfectly pleaded. It would be in direct contradiction. In any event the relationship or status of appellee was not a question which the jury was called upon to determine. No motion was made below nor are we asked to consider the complaint as amended to conform to the proof. Furthermore, appellee asserts that this was not a typical relation of master and servant but that in a sense he was acting as a contractor although not in that capacity within the meaning of the statute, but fails to point to any distinction. § 67-16-3, N.M.S.A. 1953 Comp. provides:
"A contractor within the meaning of this act is a person * * *, who for either a fixed sum, price, fee, percentage, or other compensation other than wages, undertakes or offers to undertake, or purports to have the capacity to undertake to construct, alter, repair, add to or improve any building, excavation, or other structure, project, development or improvement, or any part thereof; * * *."
That construction of a drive-in theatre such as the one here involved is a structure, project, development, or improvement within the meaning of the above statute is not denied. The complaint clearly alleges that appellee was to be paid compensation for construction other than wages during such construction. He was to receive in part, at least, a share in the net profits from the operation of the theatre. It is not denied that the appellee was required to have a license if he was acting as an independent contractor. § 67-16-14, N.M.S.A. 1953 Comp., so far as pertinent reads:
"No contractor as defined by section 3 (67-16-3) of this act shall act as agent or bring or maintain any action in any court of the state for the collection of compensation for the performance of any act for which a license is required by this act without alleging and proving that such contractor was a duly licensed contractor at the time the alleged cause of action arose."
The first question presented is whether appellee alleged facts showing he was a contractor required to be licensed. For this determination we are to look only to the allegations of the complaint. If he was, he cannot maintain this action. Salter v. Kindom Uranium Corp., supra; Fischer v. Rakagis, 59 N.M. 463, 286 P.2d 312.
The allegation is that appellants requestted appellee to construct the theatre because of his special knowledge and skill; that he was to be responsible for such construction; was to employ all necessary personnel; that all employees were to be under the sole direction and supervision of appellee, and that neither appellee nor any one employed by him were to be interfered with by appellants in any manner either in the construction or management of the theatre.
Our own decisions clearly define the distinction between an independent contractor and the relationship of master and servant. The principal test to determine whether one is an independent contractor or an employee is whether the *526 employer has any control over the manner in which the details of the work are to be accomplished. Mere suggestions by the employer nor the "directing control essential to co-ordinate the several parts of a larger undertaking" does not affect the relationship. Burruss v. B.M.C. Logging Co., 38 N.M. 254, 31 P.2d 263; DePalma v. Weinman, 15 N.M. 68, 103 P. 782, 24 L.R.A.,N.S., 423; Latta v. Harvey, 67 N.M. 72, 352 P.2d 649. We said in Burruss v. B.M.C. Logging Co., supra, 38 N.M. at page 257, 31 P.2d at page 265:
"And all agree, in statement if not in application, that it is the right to control, not the exercise of it, that furnishes the test."
The decisions were reviewed and the test to be applied in distinguishing between the relationship or status of employer and employee and independent contractor was approved in Bland v. Greenfield Gin Co., 48 N.M. 166, 146 P.2d 878; American Employers' Ins. Co. of Boston v. Grabert, 39 N.M. 173, 42 P.2d 1116. However, in those decisions we said that each case must rest upon its own state of facts.
There is not present, under the allegations of the complaint here, as under the facts in Burruss v. B.M.C. Logging Co., supra, and American Employers' Ins. Co., of Boston v. Grabert, supra, the right of the employer to terminate the employment at will which was said to give the employer the right to exercise control over the manner in which details of the work were to be exercised. The facts alleged by the complaint more nearly parallel those of Sucetti v. Jones' Estate, 38 N.M. 327, 32 P.2d 815, where plaintiff, an expert miner, who was working his adjoining claims was hired to watch defendant's claim and to do defendant's assessment work to consist of 70 feet of tunnel for an agreed price per foot, the details of the work to be left entirely to plaintiff. It was held that plaintiff was acting as an independent contractor in the assessment work. The fact that appellee was an employee of appellants in other work does not control the relationship as to the construction of the drive-in theatre.
Tested by the allegations of the complaint appellee has alleged facts showing him to be an independent contractor within the meaning of § 67-16-3, N.M.S.A. 1953 Comp., and having failed to allege that he had a contractor's license he is barred from maintaining this action by § 67-16-14, N.M.S.A. 1953 Comp. One who has shown himself to be required to have a contractor's license cannot recover under quantum meruit in the absence of such license. Kaiser v. Thomson, 55 N.M. 270, 232 P.2d 142.
Since appellee will be permitted to amend his complaint, if he be so advised, and if he should be able to state a cause of action recoverable in quantum meruit, we feel some comment should be made respecting the measure of damages to be applied if a re-trial should result. We therefore turn to the third ground urged for reversal, that the verdict was so excessive as to require a new trial. Since the cause must be remanded on other grounds it is unnecessary for us to resolve the question as to whether the verdict was excessive other than to say that the jury obviously applied the measure of damages based upon the resulting benefit, or increase in wealth to appellants, and that this measure is not applicable under the state of the record on this appeal.
There appears to be no consistency among the decided cases as to the yardstick to be used as a measure of recovery. "The same court not infrequently in different decisions suggests measures of damages which are inconsistent with each other." 5 Williston on Contracts (Rev. Ed.) § 1481 at page 4139.
Appellee asserts that the resulting benefit to appellants represented by the market value of the completed theatre less the cost to appellants, should be the measure of his recovery and points to testimony showing that the lowest estimate of the market value of the completed theatre is $70,000; that the cost to appellants, including *527 land, was $56,000 and the resulting benefit, or increase in wealth, to appellants was $14,000, the exact amount of the verdict.
Here, however, appellee agreed to construct the theatre at the lowest possible cost to appellants using all his talents, knowledge of the theatre business, and contacts in the business to obtain favorable prices for materials and equipment. Under these facts the measure of recovery to be used is that expressed in Restatement, Contracts § 347 at page 587:
"c. If the plaintiff's performance is part of the very performance for which the defendant bargained as part of an agreed exchange, it is to be valued, not by the extent to which the defendant's total wealth has been increased thereby, but by the amount for which such services and materials as constituted the part performance could have been purchased from one in the plaintiff's position at the time they were rendered."
See also Moore v. Spanish River Land Co., 118 Fla. 549, 159 So. 673; Manning v. Owens, 277 Ky. 40, 125 S.W.2d 753; Thurston v. Nutter, 126 Me. 609, 139 A. 680.
In view of our disposition other questions urged have either been determined by what we have said or need not be determined.
The cause will be remanded with instructions to set aside the verdict and the judgment based thereon; to enter an order dismissing the complaint for failure to state grounds upon which relief can be granted; to permit appellee to amend his complaint if he be so advised, and for such other proceedings as may be deemed appropriate not inconsistent with the views expressed herein. It is so ordered.
CARMODY and CHAVEZ, JJ., concur.
COMPTON, C.J., and MOISE, J., not participating.
