Implementing the two api methods