adding new code for API