Improved error handling in web.js and implemented patent data persist on the server.