Redid the way of working with callbacks.

Added onSuccess/onFailure callbacks and more convenient and lightweight
interface.