Added Restlets and moved some code around.