moved api to its own route