consolidate PUT and POST methods