Re-factored second_idea to use a twisted HTTP server instance and have the GET method mapped to a REST method 'get' that takes a URI and returns JSON on success or HTML on error
Now I'm using lxml to serialize the JSON results as XML for return to the client. It is kind of working.