add api & code tests