combined GET and POST handler