      :headers {"Content-Type" "application/xml; charset=utf-8"}
      :body (:metadata concept)}))
 
+(def concept-type-w-extension-regex
+  "A regular expression that matches URLs including the concept type (pluralized) along with a file
+  extension."
+  #"(?:granules)|(?:collections)(?:\..+)?")
+
 (defn- build-routes [system]
   (routes
     (context (get-in system [:search-public-conf :relative-root-url]) []
-      (context "/collections" []
-        (GET "/" {params :params headers :headers context :request-context query-string :query-string}
-          (find-references context :collection params headers query-string))
-        (POST "/" {params :params headers :headers context :request-context body :body-copy}
-          (find-references context :collection params headers body)))
-      (context "/granules" []
-        (GET "/" {params :params headers :headers context :request-context query-string :query-string}
-          (find-references context :granule params headers query-string))
-        (POST "/" {params :params headers :headers context :request-context body :body-copy}
-          (find-references context :granule params headers body)))
+
+      ;; Retrieve by cmr concept id
       (context "/concepts/:cmr-concept-id" [cmr-concept-id]
         (GET "/" {headers :headers context :request-context}
           (find-concept-by-cmr-concept-id context cmr-concept-id headers)))
+
+      ;; Find concepts
+      (context ["/:concept-type-w-extension" :concept-type-w-extension concept-type-w-extension-regex] [concept-type-w-extension]
+        (GET "/" {params :params headers :headers context :request-context query-string :query-string}
+          (find-concepts context concept-type-w-extension params headers query-string))
+        (POST "/" {params :params headers :headers context :request-context body :body-copy}
+          (find-concepts context concept-type-w-extension params headers body)))
 
       ;; reset operation available just for development purposes
       ;; clear the cache for search app

        took (- stop start)]
    (assoc result :took took)))

(defn- find-references
  "Invokes query service to find references and returns the response"
  [context concept-type params headers query-string]
  (let [result-format (get-search-results-format headers)
        params (assoc params :result-format result-format)
        pretty? (= (get params :pretty) "true")
        _ (info (format "Searching for %ss in format %s with params %s." (name concept-type) result-format (pr-str params)))

            [ring.middleware.json :as ring-json]
            [cmr.common.log :refer (debug info warn error)]
            [cmr.common.api.errors :as errors]
            [cmr.common.services.errors :as svc-errors]
            [cmr.common.mime-types :as mt]
            [cmr.search.services.query-service :as query-svc]
            [cmr.system-trace.http :as http-trace]
            [cmr.search.api.search-results :as sr]
            [cmr.search.services.parameters.legacy-parameters :as lp]))


(defn- measure-query-time
  "Executes the query function measuring how long it takes. Adds a :took key to the results map
