Fix exception & make refresh inline when adding keys

When adding a key an exception due to dereferencing a key not in the
bunch is thrown, this has been fixed.

Also make refreshing unnecessary by pulling API details inline.
Merge pull request #86 from noilek/my-fork-master

Fix exception & make refresh inline when adding keys