Added error handling and auto-showing of response div.