some changes to API encryption