login_required functions and logout function and also ajax search added