BROKEN CODE. Adds server-side logic and additional front-end logic.