converting the dashboard api to be asynchronous using Promises