Base rest-api wrapper for connect middleware