fix the api route to work with both get and post

the JS can use either