modified rephraser to be used as a standalone API as well