Refactored server response to requests. Using REST approach