api correctly responds to a post request