Improved update API function and other improvements