added registration using ajax for better client side error handling in the future