added callbackURL support and debugging output