modifying json output for errors in registration controller