Remove direct access to the DB and use the PHPMinds-API for all interactions: https://github.com/phpminds/api