Removed stub code and added proper implementation routine for accessing datastore and refined function api formats