Fixed some bugs with transactions and security. Made updates asyncronous.