refactor put & post rest webserver routes in one route, as we are doing upsert in any way