implemented xmlhttprequest to recieve JSON from url