Fixed some problems

Still getting mongodb errors and JSON and AJAX calling problems