added globalId field to all objects that are synchronized with server, added handling of id <-> globalId mapping, fixed saving locations when object is already in database