With a 500 error, you should find a message inside your server error logs. That would help narrow the issue down. But I suspect what might be happening is the call to
Test
inside the definition of your Test
function - you've got an infinite recursive loop there.