Copying in some code from my node-mysql-json-server project