Added AJAX functionality
Error message: No function inside loop allowed
Error message: Origin Null is not allowed by Access Control Allow Origin