Added consistency with library

Return-types are updated. 
Code-example for key is now updated to assign "err" as well.