added ajax, update and submit methods
added ajax functionality