Removed debugging code.
For some reason the server is returning 500 randomly.