initial code of api