Removed middleware/generate.js
Added middleware/common.js

New functions
* setShortId()
* json()

The common.json(req, res) function generates a callback function for
mongoose's queries and automatically returns the data or an error in
a JSON format to the client.