Added domain api
Added generate token logic
Added support for update domains