Make REST methods return values instead of printing