Fix Null pointers in API - Lets try this again

Its possible for the update() function to refrence a null string, and this fixes the
null pointers by checking first