Refactor GET and POST operations