Returning JSON results now. Tests need fixing though