modified the API to include some smart shit