fixing api bugs introduced by last commit