title: routing error uninitialized constant API rails
body: <p>I have referred this <a href="http://collectiveidea.com/blog/archives/2013/06/13/building-awesome-rails-apis-part-1/" rel="noreferrer">link</a></p>
  
  <p>to create my own api but facing an routing error since this is the first time am using namespace.</p>
  
  <p>This is the controller I have</p>
  
  <pre><code>class API::IndexController &lt; ApplicationController
    def index
      @clients = Client.all
      respond_to do |format|
          format.json
      end
    end
  end
  </code></pre>
  
  <p>my route has</p>
  
  <pre><code>  namespace :api do
      resources :index
    end
  </code></pre>
  
  <p>Here is my inflection.rb</p>
  
  <pre><code>ActiveSupport::Inflector.inflections(:en) do |inflect|
      inflect.acronym 'API'
  end
  </code></pre>
  
  <p>Once i finish it I tried localhost:3000/api/index.json but throwing error as</p>
  
  <pre><code>    Routing Error
  uninitialized constant API
  </code></pre>
  
  <p>Can anyone help.</p>