Moved networking code to AsyncTask class