routing improved, json api inited, db connection test, error handling added