change directory from rest to api