complete api, need some cleaning