fixing document functions to choose post or put method based on document