Changed login process and integrate org.json library for reading json data