modified update method to return T

I also updated this to begin the transaction, flush, commit and return T