Working analyze endpoint, just need to clean up the output format.