test code for API