Implementing orm and auth framework