changed POST methods and add a PUT method