Implemented all API functions