adding a message service
making registration work with ajax and messages