Fix case where we open newly created account

Return last insert id
Add operation creation