Add support to multiple databases. I tried keeping the API the same so that it is backwards compatible