Refactored post and get methods