Fixed all db errors, JSON API is working.