fixes KON-18
operations with session wrapped with try finally
creating session factory wrapped with try finally
added 500 http response
changed response of action 500 to ServerError