Returning ids instead of objects

This will avoid the problem of ciclic imports