title: Laravel API routing issue
body: <p>I'm working on Laravel 5 and I'm starting an API, so I just created a very simple route and controller just to test where the route will be hit. This is what I have in the <code>routes\api.php</code></p>
  
  <pre><code>Route::group(array('prefix' =&gt; 'test', 'middleware' =&gt; ['guest']), function()
  {
      Route::get('/', 'Aiapi\BaseAIApiController@index');
  
  });
  </code></pre>
  
  <p>And the controller:</p>
  
  <pre><code>class BaseAIApiController extends Controller
  {
      public function index()
      {
          return 'HI';
      }
  }
  </code></pre>
  
  <p>In my <code>Http\Kernel.php</code>, this is how the guest middleware is declared inside the <code>$routeMiddleware</code> variable: <code>'guest' =&gt; \App\Http\Middleware\RedirectIfAuthenticated::class,</code> and this is the content of the <code>handle</code> method (I commented the if block and same thing happens):</p>
  
  <pre><code>public function handle($request, Closure $next, $guard = null)
  {
      if (Auth::guard($guard)-&gt;check()) {
          return redirect('/home');
      }
  
      return $next($request);
  }
  </code></pre>
  
  <p>When I execute <code>php artisan route:list</code> I see this route there, I also executed <code>php artisan route:clear</code>
  but when I hit <code>/api/test/</code>I get redirected to the home page of the website. Here is the content of the <code>.htaccess</code> inside the <code>public</code> folder:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      RewriteRule thumb/([[:alnum:]]+)\/(.*) thumbnail/?src=$2&amp;params=$1 [QSA,L,NC]
  
      # Redirect Trailing Slashes If Not A Folder...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} (.+)/$
      RewriteRule ^ %1 [L,R=301]
  
      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  
      # Handle Authorization Header
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I tried removing the line block with the <code>301 redirect</code> but it does the same thing. What AM I doing wrong here? I've been trying answers of similar questions on StackOverflow and so far none worked for me.</p>
  
  <p>Thanks for any help</p>