Cant get hdd out of the tray

The screws are definitely holding the drive into the tray. You need to use the proper phillips head driver (likely #2) and apply some good pressure into the center of the screw while unscrewing it to prevent slipping out. If you're having a difficult time getting a good grip you might try a rubberband placed over the screw head and pressing the tip of the screwdriver into the screw (and rubberband) allowing the rubberband to act as better grip for the driver to screw.