migrate API endpoint from static of dynamic