Sending 404 response if matching criteria is not happening. Also returning fully processed HTML if target element criteria is not specified