Use try/finally clause;

Catch exception to be logged on debug state
Use when instead of if when no else branch
remove unnecessary lambda
extract add-id from add-ids for clarity
remove unnecessary newlines
Merge pull request #5 from pietu/fix/refactor-db-client

Fix/refactor db client