title: What is the essence of "exposing" an API especially in Google Cloud Endpoint?
body: <p>I am totally new to the whole Google Cloud Endpoint/Google App Engine world. If you have gone through the Hello World example that Google provides(and you probably have), you might remember that there are 2 classes that are auto-generated for you: <code>MyBean</code> and <code>MyEndpoint</code>.</p>
  
  <p>These are something like this:</p>
  
  <pre><code>/**
   * The object model for the data we are sending through endpoints
   */
  public class MyBean {
  
      private String myData;
  
      public String getData() {
          return myData;
      }
  
      public void setData(String data) {
          myData = data;
      }
  }
  </code></pre>
  
  <p>And,</p>
  
  <pre><code>/**
   * An endpoint class we are exposing
   */
  @Api(
          name = "myApi",
          version = "v1",
          namespace = @ApiNamespace(
                  ownerDomain = "backend.myapplication.DJ.example.com",
                  ownerName = "backend.myapplication.DJ.example.com",
                  packagePath = ""
          )
  )
  public class MyEndpoint {
  
      /**
       * A simple endpoint method that takes a name and says Hi back
       */
      @ApiMethod(name = "sayHi")
      public MyBean sayHi(@Named("name") String name) {
          MyBean response = new MyBean();
          response.setData("Hi, " + name);
  
          return response;
      }
  
  }
  </code></pre>
  
  <p>Now, I examined the code in index.html(which gets opened on deploying the backend). I found the following call in the javascript:</p>
  
  <pre><code>gapi.client.myApi.sayHi({'name': name}).execute(
  </code></pre>
  
  <p>Now, I can see that myApi is the name through annotation and sayHi() is the corresponding method, What I don't understand is the concept of exposing an API and annotation is aiding in that. There isn't any information about exposing APIs.</p>
  
  <p>Could anyone help me understand this?</p>