Code refactoring. Add comments to code
Replace post and put methods to satisfy rest API specification