Adds Default id Generation and fixes return of putObject

Also adds test for the funcionality and correction of the bug.