                 
                 // MARK: HTTP Function Request Handler Block
                 
-                let functionExpression = "{^/" + path + "/(\\d+)/" + functionName + "}"
+                let functionExpressionPath = "{^/" + path + "/(\\d+)/" + functionName + "}"
                 
                 let functionRequestHandler: RequestHandler = { (request: RouteRequest!, response: RouteResponse!) -> Void in
                     
-                    
-                    
-                }
+                    let parameters = request.params
+                    
+                    let captures: AnyObject? = parameters["captures"]
+                    
+                    // had to do this in more lines of code becuase the compiler would complain
+                    let capturesArray = captures as [String]
+                    
+                    let resourceID = capturesArray.first?.toInt()
+                    
+                    // get json body
+                    
+                    let jsonBody: AnyObject? = NSJSONSerialization.JSONObjectWithData(request.body(), options: NSJSONReadingOptions.AllowFragments, error: nil)
+                    
+                    let jsonObject = jsonBody as? [String: AnyObject]
+                    
+                    // JSON recieved is not a dictionary
+                    if (jsonBody != nil) && (jsonObject == nil) {
+                        
+                        response.statusCode = ServerStatusCode.BadRequest.toRaw()
+                        
+                        return
+                    }
+                    
+                    // convert to server request
+                    let serverRequest = ServerRequest(requestType: ServerRequestType.Function, connectionType: ServerConnectionType.HTTP, entity: entity, underlyingRequest: request, resourceID: resourceID, JSONObject: jsonObject, functionName: functionName)
+                    
+                    // get response
+                    let (serverResponse, userInfo) = self.responseForFunctionRequest(serverRequest)
+                    
+                    // respond with JSON if availible
+                    if serverResponse.JSONResponse != nil  {
+                        
+                        // write to socket
+                        
+                        let errorPointer = NSErrorPointer()
+                        
+                        let jsonData = NSJSONSerialization.dataWithJSONObject(serverResponse.JSONResponse!, options: self.jsonWritingOption(), error: errorPointer)
+                        
+                        // could not serialize json response, internal error
+                        if (jsonData == nil) {
+                            
+                            self.delegate!.server(self, didEncounterInternalError: errorPointer.memory!, forRequest: serverRequest, userInfo: userInfo)
+                            
+                            response.statusCode = ServerStatusCode.InternalServerError.toRaw()
+                            
+                            return
+                        }
+                        
+                        // respond with serialized json
+                        response.respondWithData(jsonData);
+                    }
+                    
+                    // set function status code
+                    response.statusCode = serverResponse.statusCode.toRaw()
+                    
+                    // tell the delegate
+                    self.delegate!.server(self, didPerformRequest: serverRequest, withResponse: serverResponse, userInfo: userInfo)
+                }
+                
+                httpServer.post(functionExpressionPath, withBlock: functionRequestHandler)
             }
         }
         

                    
                    let error = NSErrorPointer()
                    
                    let jsonData = NSJSONSerialization.dataWithJSONObject(serverResponse.JSONResponse, options: self.jsonWritingOption(), error: error);
                    
                    // could not serialize json response, internal error
                    if (jsonData == nil) {

                        
                        let jsonSerializationError = NSErrorPointer()
                        
                        let jsonData = NSJSONSerialization.dataWithJSONObject(serverResponse.JSONResponse!, options: self.jsonWritingOption(), error: jsonErrorPointer)
                        
                        if (jsonData == nil) {
                            
