added more checks and started modifying grader.js to use restler.