Modularized server a little better. Fixed broken JSON response