         
         httpServer.setConnectionClass(HTTPConnection);
         
-        
+        for (path, entity) in self.entitiesByResourcePath {
+            
+            // add search handler
+            
+            if (self.searchPath != nil) {
+                
+                let searchExpression = "/" + self.searchPath! + "/" + path
+                
+                let searchRequestHandler: RequestHandler = { (request: RouteRequest!, response: RouteResponse!) -> Void in
+                    
+                    let jsonErrorPointer = NSErrorPointer();
+                    
+                    let searchParameters = NSJSONSerialization.JSONObjectWithData(request.body(), options: NSJSONReadingOptions.AllowFragments, error: jsonErrorPointer) as? [String: AnyObject]
+                    
+                    if ((jsonErrorPointer.memory != nil) || (searchParameters != nil)) {
+                        
+                        response.statusCode = ServerStatusCode.BadRequest.toRaw();
+                        
+                        return
+                    }
+                    
+                    // create server request
+                    
+                    let serverRequest = ServerRequest(requestType: ServerRequestType.Search, connectionType: ServerConnectionType.HTTP, entity: entity, underlyingRequest: request, resourceID: nil, JSONObject: searchParameters, functionName: nil);
+                    
+                    
+                }
+            }
+            
+        }
         
         return httpServer;
     }

        if (delegate? != nil) {
            self.delegate = delegate!;
        }
        if (searchPath?  != nil){
            self.searchPath = searchPath!;
        }
        if (sslIdentityAndCertificates != nil) {
            self.sslIdentityAndCertificates = sslIdentityAndCertificates;
        }

    
    /** The string that will be used to generate a URL for search requests. 
    NOTE: Must not conflict with the resourcePath of entities.*/
    public let searchPath: String?;
    
    /** Determines whether the exported JSON should have whitespace for easier readability. */
    public let prettyPrintJSON: Bool = false
