diff --git a/rest-wai.cabal b/rest-wai.cabal
--- a/rest-wai.cabal
+++ b/rest-wai.cabal
@@ -1,5 +1,5 @@
 name:                rest-wai
-version:             0.1.0.0
+version:             0.1.0.1
 description:         Rest driver for WAI applications.
 synopsis:            Rest driver for WAI applications.
 maintainer:          code@silk.co
@@ -34,5 +34,5 @@
     , text                 == 1.1.*
     , unordered-containers == 0.2.*
     , utf8-string          == 0.3.*
-    , wai                  == 2.1.*
+    , wai                  >= 2.1 && < 3.1
 
diff --git a/src/Rest/Driver/Wai.hs b/src/Rest/Driver/Wai.hs
--- a/src/Rest/Driver/Wai.hs
+++ b/src/Rest/Driver/Wai.hs
@@ -1,5 +1,5 @@
 {-# OPTIONS_GHC -fno-warn-orphans #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving, OverloadedStrings, RankNTypes #-}
+{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, OverloadedStrings, RankNTypes #-}
 module Rest.Driver.Wai (apiToApplication) where
 
 import Control.Applicative
@@ -25,9 +25,16 @@
 
 apiToApplication :: Run m IO -> Api m -> Application
 apiToApplication run api req =
+#if MIN_VERSION_wai(3,0,0)
+  \cont ->
   do ri <- toRestInput req
      (bs, ro) <- runRestM ri (Rest.apiToHandler' (lift . run) api)
-     return (fromRestOutput ro bs)
+     cont (fromRestOutput ro bs)
+#else
+  do ri <- toRestInput req
+     (bs, ro) <- runRestM ri (Rest.apiToHandler' (lift . run) api)
+     return $ fromRestOutput ro bs
+#endif
 
 toRestInput :: Request -> IO RestInput
 toRestInput req =
@@ -52,7 +59,7 @@
                         "DELETE" -> Rest.DELETE
                         other    -> Rest.Unknown (string other)
 
-       , paths      = text <$> pathInfo req
+       , paths      = text <$> filter (not . Text.null) (pathInfo req)
 
        , mimeTypes  = HashMap.fromList
                     . fmap (text *** string)
