Within controllers and functions called by controllers, error handling is important. Without proper error processing the server will always return 500 ISEs as exceptions remain uncaught. Previously this was handled using lots of if statements and returning early with an error response. New this year are ApiExceptions, which are runtime exceptions with an embedded ErrorCode (which, in turn, contain their corresponding HTTP status codes).
Such exceptions that are not caught by any controller are handled by the REST exception handler, which takes the error code and the message and replies it in an error response. Important to note is that this way only one error can be returned and that exception messages are visible to the client, so care must be taken not to include sensitive data in the messages. The stack trace is not sent however.