Made sure entitymanager always is closed. Working some more on loggin in and registering.