moved api to top