Changes to work with api keystone. Changes for tests