Merge RestAPI with basic funcionality

debug code?