fix key lookup and made json wrapper the primary