added POST functions and test in main