Refactored restFunctions, removed stuff that arent rest related at all