moved the location of the api code