Add back-end logic.

Use mongoose instead of mongoskin.