edited the beginning
refactored status code's part
refactored resources