First version of API implementation