Cleaned up backend and added indices