restructed entire backend to suit rdbms for mysql