tidier implementation + bugfix
each request should be a transaction