What are the core principles of RESTful API design, and how do you handle error states in a microservices architecture?