changed api stucture (a littele bit ogly)