Fixes authentication and add proper error and success messages.