Currently, the server-side code is a callback-noodle soup - switching to a Promise-based approach would be good practice, and nice cleanup.