title: Putting a Cloud Endpoints API in a separate App Engine module
body: <p>I am developing an App Engine app and plan to also provide an API. I would like to separate this API from the main site, so I'm trying to use the "modules" feature to separate both apps. The main site would be the "default" module, and the API would lie in the "api" module. However, I'm having troubles with this.</p>
  
  <p>Right now my main app's YAML file is like this:</p>
  
  <pre><code>application: my-app
  module: default
  runtime: python27
  api_version: 1
  
  ...
  
  handlers:
  # Root handler
  - url: /.*
    script: main.app
    secure: always
  
  ...
  </code></pre>
  
  <p>And the API module YAML file, like this:</p>
  
  <pre><code>application: my-app
  module: api
  runtime: python27
  api_version: 1
  
  handlers:
  # Endpoints handler
  - url: /_ah/spi/.*
    script: api_main.app
    secure: always
  
  ...
  </code></pre>
  
  <p>On the development server, the app is served on port 8000, and the API on port 7998.</p>
  
  <p>With this configuration, my API doesn't work. Whenever I try to access it using localhost:7998/_ah/api/explorer, I don't get any result. If I try to run an API request manually, I get the following error: <code>{"error": {"message": "BackendService.getApiConfigs Error"}}</code>.</p>
  
  <p>What's strange is I'm also seeing the following lines in the development server logs:</p>
  
  <pre><code>INFO     2014-06-15 18:00:32,368 module.py:639] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 500 -
  INFO     2014-06-15 18:00:32,368 module.py:639] api: "GET /_ah/api/my-app/v1/events HTTP/1.1" 500 60
  </code></pre>
  
  <p>It seems like the API module is trying to POST data to the default module (as seen in the first line of logs).</p>
  
  <p>Right now, the only workaround I found is to add the same handlers for <code>/_ah/spi/.*</code> in the default YAML file, but in this situation the separation between the main app and the API is not effective.</p>
  
  <p>Can someone tell me if the configuration I'm trying to achieve is supported by Cloud Endpoints?
  Thank you very much! </p>