Some bug fixes and remote access to database.

I’ve added some new features but they’re still need to be tested.