Added callback support to all functions.