finish first version of api