adds client side form validation on the title field so that submission cannot occur without title. Also adds server side check and returns an error message just in case the client side check fails for some reason