Added more ajax tests
Added tests for services
Fixed the service code to return errors
Added the valid file check on server-side also.