Brain: Adding login required and permission protection for json url. Also adding more test coverage for survey completion