implements updating and syncing firebase, server and clients