Fixed mysql bug
Added interface for DB access