title: Adding API endpoint to existing Rails 5 app
body: <p>I  need to add an API endpoint to a Rails (5.0.2) app so I have created a <code>TransitController</code> under <code>app/controllers/api</code>.</p>
  
  <p>The controller, for now, looks like</p>
  
  <pre><code>module Api   
    class TransitController &lt; ActionController::Api
      def create 
        respond_to do |format|
          format.json { render :status =&gt; :ok, :nothing =&gt; true }
        end
      end
    end
  end
  </code></pre>
  
  <p>I have updated my <code>routes</code> as follows</p>
  
  <pre><code>  namespace :api do
      post 'transits', to: 'transits#create'
    end
  </code></pre>
  
  <p>But now, when I try to hit the endpoint via curl I get </p>
  
  <blockquote>
    <p>ActionController::RoutingError (uninitialized constant
    ActionController::Api)</p>
  </blockquote>
  
  <p>In Rails 5+, shouldn't <code>ActionController::Api</code> be available by default?</p>
  
  <p>Am I missing anything here?</p>
  
  <p>Thanks</p>