fixed need for web.xml and better error handling in resource