modified the result and rest endpoints to get a more generic and usable API