code: func (gr *goResource) generateAPIImplementations(dir string) error {
  	// generate the main API impl file, which only contains struct
  	mainCtx := map[string]interface{}{
  		"PackageName": gr.PackageName,
  		"Name":        gr.Name,
  		"Endpoint":    gr.Endpoint,
  	}
  
  	mainFile := filepath.Join(dir, strings.ToLower(gr.Name)+"_api")
  	if err := commons.GenerateFile(mainCtx, "./templates/golang/server_resource_api_main_go.tmpl",
  		"server_resource_api_main_go", mainFile+".go", false); err != nil {
  		return err
  	}
  
  	// generate per methods file
  	for _, sm := range gr.Methods {
  		ctx := map[string]interface{}{
  			"Method":      sm,
  			"APIName":     gr.Name,
  			"PackageName": gr.PackageName,
  		}
  		filename := mainFile + "_" + sm.MethodName + ".go"
  		if err := commons.GenerateFile(ctx, "./templates/golang/server_resource_api_impl_go.tmpl",
  			"server_resource_api_impl_go", filename, false); err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // generate API implementation in one file per method mode