Changes from @annapawlicka's suggestions.

Better success and error handlers.