added name field, and error and success messaging