Added Ajax callback and controller method to check db.