Working db entities retrieval and json conversion