Ajax feature

so, it's not letting me do it this way. it's having trouble with using the res and req that i am using in the callback functions for my post and get.