added error handling and post adding feature which doesn't work, the servlet mapping seems is not working properly