Fixed several small JS bugs. Fixed broken JSON requests