added basic api methods adapted from comments example