Added http-methods dependency and refactored code a bit