A utility to build json api responses from ordinary json objects