Added appropriate HTTP Response Codes to REST API