fixed migration and return json to client