1. Currently the request is made through 'POST', it needed to be made into AJAX.
2. The code needed to be optimized and to be cleaned.