added javascript api to handle front end functionality for dashboard