api: create endpoints dynamically.