add login, register, serialize doctrine response to JSON