How to write an API endpoint in 2016 >> next