Merge DB sample with the API client (main.js)