made tests wait for ajax to resolve
using async for callback logic