Refactored with async and created some tests

Change-Id: If6178ab9cd7bfb1b9bb4580a7bc059e5728491b2