refactoring success and error urls, transaction handling added