making ajax call and fetching object done