public static function callFunction( $handler , $matched, $method ) 
	{
		if ( $handler ) {	
			if ( is_callable( $handler ) ) {
				$newParams = call_user_func_array( $handler, $matched ) ;
			} else {
		
				/* Check if class exists in the case user is using RESTful pattern  */
		
				if( class_exists( $handler ) ) {
					$instanceOfHandler = new $handler(); // Won't work in case of middleware since we aren't using RESTful in that
				} else {
					print_r('Class or function ' . $handler . ' not found');
					header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
					die();
				}
			}
		} else {
			self::handle404();
		}

		if( isset( $instanceOfHandler ) ) {
			if( method_exists( $instanceOfHandler, $method ) ) {
				try {
					$newParams = call_user_func_array( array( $instanceOfHandler, $method ), $matched );
				} catch ( Exception $exception ){
					$string = str_replace("\n", ' ', var_export($exception, TRUE));
					error_log($string); //Log to error file only if display errors has been declared
					header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
					die();
				} 	
			}
		}
		if( isset( $newParams ) && $newParams ) {
			return $newParams;		
		}
	}