fixing identations and using AsyncTask avoiding sending requests from Main Thread